-/*
- * mini.c: The new Mono code generator.
+/**
+ * \file
+ * The new Mono code generator.
*
* Authors:
* Paolo Molaro (lupus@ximian.com)
}
}
-#define MONO_INIT_VARINFO(vi,id) do { \
- (vi)->range.first_use.pos.bid = 0xffff; \
- (vi)->reg = -1; \
- (vi)->idx = (id); \
-} while (0)
-
/**
* mono_unlink_bblock:
*
cfg->varinfo [num] = inst;
- MONO_INIT_VARINFO (&cfg->vars [num], num);
- MONO_VARINFO (cfg, num)->vreg = vreg;
+ cfg->vars [num].idx = num;
+ cfg->vars [num].vreg = vreg;
+ cfg->vars [num].range.first_use.pos.bid = 0xffff;
+ cfg->vars [num].reg = -1;
if (vreg != -1)
set_vreg_to_inst (cfg, vreg, inst);
/* fixme: align to MONO_ARCH_CODE_ALIGNMENT */
#ifdef MONO_ARCH_HAVE_UNWIND_TABLE
- unwindlen = mono_arch_unwindinfo_get_size (cfg->arch.unwindinfo);
+ unwindlen = mono_arch_unwindinfo_init_method_unwind_info (cfg);
#endif
if (cfg->method->dynamic) {
mono_debug_close_method (cfg);
#ifdef MONO_ARCH_HAVE_UNWIND_TABLE
- mono_arch_unwindinfo_install_unwind_info (&cfg->arch.unwindinfo, cfg->native_code, cfg->code_len);
+ mono_arch_unwindinfo_install_method_unwind_info (&cfg->arch.unwindinfo, cfg->native_code, cfg->code_len);
#endif
}
gboolean llvm = (flags & JIT_FLAG_LLVM) ? 1 : 0;
#endif
static gboolean verbose_method_inited;
- static const char *verbose_method_name;
+ static char *verbose_method_name;
InterlockedIncrement (&mono_jit_stats.methods_compiled);
if (mono_profiler_get_events () & MONO_PROFILE_JIT_COMPILATION)
if (cfg->gen_seq_points)
cfg->seq_points = g_ptr_array_new ();
- mono_error_init (&cfg->error);
+ error_init (&cfg->error);
if (cfg->compile_aot && !try_generic_shared && (method->is_generic || mono_class_is_gtd (method->klass) || method_is_gshared)) {
cfg->exception_type = MONO_EXCEPTION_GENERIC_SHARING_FAILED;
}
cfg->method_to_register = method_to_register;
- mono_error_init (&err);
+ error_init (&err);
sig = mono_method_signature_checked (cfg->method, &err);
if (!sig) {
cfg->exception_type = MONO_EXCEPTION_TYPE_LOAD;
cfg->disable_ssa = TRUE;
}
+ if (cfg->num_varinfo > 10000 && !cfg->llvm_only)
+ /* Disable llvm for overly complex methods */
+ cfg->disable_ssa = TRUE;
+
if (cfg->opt & MONO_OPT_LOOP) {
MONO_TIME_TRACK (mono_jit_stats.jit_compile_dominator_info, mono_compile_dominator_info (cfg, MONO_COMP_DOM | MONO_COMP_IDOM));
MONO_TIME_TRACK (mono_jit_stats.jit_compute_natural_loops, mono_compute_natural_loops (cfg));
GTimer *jit_timer;
MonoMethod *prof_method, *shared;
- mono_error_init (error);
+ error_init (error);
if ((method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) ||
(method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL)) {
* mini_get_underlying_type:
*
* Return the type the JIT will use during compilation.
- * Handles: byref, enums, native types, generic sharing.
+ * Handles: byref, enums, native types, bool/char, ref types, generic sharing.
* For gsharedvt types, it will return the original VAR/MVAR.
*/
MonoType*