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
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);
- /*
- * Avoid initializing the runtime when AOT compiling, since the platform
- * might only support aot-only execution.
- */
- if (!mono_compile_aot) {
- mono_runtime_init (domain, mono_thread_start_cb, mono_thread_attach_cb);
- mono_thread_attach (domain);
- }
+ mono_runtime_init (domain, mono_thread_start_cb, mono_thread_attach_cb);
+ mono_thread_attach (domain);
#endif
mono_profiler_runtime_initialized ();
/* This accesses metadata so needs to be called before runtime shutdown */
print_jit_stats ();
- if (!mono_compile_aot)
- mono_runtime_cleanup (domain);
+ mono_runtime_cleanup (domain);
mono_profiler_shutdown ();