MonoTraceSpec *mono_jit_trace_calls = NULL;
gboolean mono_break_on_exc = FALSE;
-#ifndef DISABLE_AOT
gboolean mono_compile_aot = FALSE;
-#endif
/* If this is set, no code is generated dynamically, everything is taken from AOT files */
gboolean mono_aot_only = FALSE;
/* Whenever to use IMT */
return NULL;
MONO_INST_NEW (cfg, ins, OP_TLS_GET);
- ins->dreg = mono_regstate_next_int (cfg->rs);
+ ins->dreg = cfg->new_ir ? mono_alloc_preg (cfg) : mono_regstate_next_int (cfg->rs);
ins->inst_offset = offset;
return ins;
#else
register_icall (mono_array_new_2, "mono_array_new_2", "object ptr int int", FALSE);
#endif
+ mono_generic_sharing_init ();
+
+ if (mono_compile_aot)
+ /*
+ * Avoid running managed code when AOT compiling, since the platform
+ * might only support aot-only execution.
+ */
+ mono_runtime_set_no_exec (TRUE);
+
#define JIT_RUNTIME_WORKS
#ifdef JIT_RUNTIME_WORKS
mono_install_runtime_cleanup ((MonoDomainFunc)mini_cleanup);
mono_runtime_init (domain, mono_thread_start_cb, mono_thread_attach_cb);
+ mono_thread_attach (domain);
#endif
- mono_generic_sharing_init ();
-
- mono_thread_attach (domain);
-
mono_profiler_runtime_initialized ();
MONO_PROBE_VES_INIT_END ();