int align_pad_value;
guint32 label_generator;
gboolean llvm;
+ gboolean has_jitted_code;
MonoAotFileFlags flags;
MonoDynamicStream blob;
MonoClass **typespec_classes;
flags |= JIT_FLAG_LLVM;
if (acfg->aot_opts.no_direct_calls)
flags |= JIT_FLAG_NO_DIRECT_ICALLS;
- cfg = mini_method_compile (method, acfg->opts, mono_get_root_domain (), flags, 0);
+ cfg = mini_method_compile (method, acfg->opts, mono_get_root_domain (), flags, 0, index);
mono_loader_clear_error ();
if (cfg->exception_type == MONO_EXCEPTION_GENERIC_SHARING_FAILED) {
return;
}
+ if (!cfg->compile_llvm)
+ acfg->has_jitted_code = TRUE;
+
if (method->is_inflated && acfg->aot_opts.log_instances) {
if (acfg->instances_logfile)
fprintf (acfg->instances_logfile, "%s ### %d\n", mono_method_full_name (method, TRUE), cfg->code_size);
run++;
start_time = g_timer_elapsed (timer, NULL);
comp_time -= start_time;
- cfg = mini_method_compile (method, mono_get_optimizations_for_method (method, opt_flags), mono_get_root_domain (), JIT_FLAG_RUN_CCTORS, 0);
+ cfg = mini_method_compile (method, mono_get_optimizations_for_method (method, opt_flags), mono_get_root_domain (), JIT_FLAG_RUN_CCTORS, 0, -1);
comp_time += g_timer_elapsed (timer, NULL);
if (cfg->exception_type == MONO_EXCEPTION_NONE) {
if (verbose >= 2)
g_print ("Compiling %d %s\n", count, desc);
g_free (desc);
}
- cfg = mini_method_compile (method, mono_get_optimizations_for_method (method, args->opts), mono_get_root_domain (), 0, 0);
+ cfg = mini_method_compile (method, mono_get_optimizations_for_method (method, args->opts), mono_get_root_domain (), 0, 0, -1);
if (cfg->exception_type != MONO_EXCEPTION_NONE) {
printf ("Compilation of %s failed with exception '%s':\n", mono_method_full_name (cfg->method, TRUE), cfg->exception_message);
fail_count ++;
(method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)) {
MonoMethod *nm;
nm = mono_marshal_get_native_wrapper (method, TRUE, FALSE);
- cfg = mini_method_compile (nm, opt, mono_get_root_domain (), 0, part);
+ cfg = mini_method_compile (nm, opt, mono_get_root_domain (), 0, part, -1);
}
else
- cfg = mini_method_compile (method, opt, mono_get_root_domain (), 0, part);
+ cfg = mini_method_compile (method, opt, mono_get_root_domain (), 0, part, -1);
if ((mono_graph_options & MONO_GRAPH_CFG_SSA) && !(cfg->comp_done & MONO_COMP_SSA)) {
g_warning ("no SSA info available (use -O=deadce)");
return 1;
opt = opt_sets [i];
g_timer_start (timer);
for (j = 0; j < count; ++j) {
- cfg = mini_method_compile (method, opt, mono_get_root_domain (), 0, 0);
+ cfg = mini_method_compile (method, opt, mono_get_root_domain (), 0, 0, -1);
mono_destroy_compile (cfg);
}
g_timer_stop (timer);
(method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL))
method = mono_marshal_get_native_wrapper (method, TRUE, FALSE);
- cfg = mini_method_compile (method, opt, mono_get_root_domain (), 0, 0);
+ cfg = mini_method_compile (method, opt, mono_get_root_domain (), 0, 0, -1);
mono_destroy_compile (cfg);
}
}
} else {
- cfg = mini_method_compile (method, opt, mono_get_root_domain (), 0, 0);
+ cfg = mini_method_compile (method, opt, mono_get_root_domain (), 0, 0, -1);
mono_destroy_compile (cfg);
}
#endif
* field in the returned struct to see if compilation succeded.
*/
MonoCompile*
-mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFlags flags, int parts)
+mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFlags flags, int parts, int aot_method_index)
{
MonoMethodHeader *header;
MonoMethodSignature *sig;
cfg->orig_method = method;
cfg->gen_seq_points = debug_options.gen_seq_points_compact_data || debug_options.gen_sdb_seq_points;
cfg->gen_sdb_seq_points = debug_options.gen_sdb_seq_points;
+ cfg->flags = flags;
#ifdef PLATFORM_ANDROID
if (cfg->method->wrapper_type != MONO_WRAPPER_NONE) {
cfg->generic_sharing_context = (MonoGenericSharingContext*)&cfg->gsctx;
cfg->compile_llvm = try_llvm;
cfg->token_info_hash = g_hash_table_new (NULL, NULL);
+ if (cfg->compile_aot)
+ cfg->method_index = aot_method_index;
if (!mono_debug_count ())
cfg->opt &= ~MONO_OPT_FLOAT32;
jit_timer = g_timer_new ();
- cfg = mini_method_compile (method, opt, target_domain, JIT_FLAG_RUN_CCTORS, 0);
+ cfg = mini_method_compile (method, opt, target_domain, JIT_FLAG_RUN_CCTORS, 0, -1);
prof_method = cfg->method;
g_timer_stop (jit_timer);
void mono_global_regalloc (MonoCompile *cfg);
void mono_create_jump_table (MonoCompile *cfg, MonoInst *label, MonoBasicBlock **bbs, int num_blocks);
int mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options);
-MonoCompile *mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFlags flags, int parts);
+MonoCompile *mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFlags flags, int parts, int aot_method_index);
void mono_destroy_compile (MonoCompile *cfg);
MonoJitICallInfo *mono_find_jit_opcode_emulation (int opcode);
void mono_print_ins_index (int i, MonoInst *ins);