2008-08-28 Zoltan Varga <vargaz@gmail.com>
authorZoltan Varga <vargaz@gmail.com>
Thu, 28 Aug 2008 20:20:58 +0000 (20:20 -0000)
committerZoltan Varga <vargaz@gmail.com>
Thu, 28 Aug 2008 20:20:58 +0000 (20:20 -0000)
* mini.c: Avoid not initializing the runtime when doing AOT compilation,
since too many things depend on it. Instead, call
mono_runtime_set_no_exec ().

svn path=/trunk/mono/; revision=111867

mono/mini/ChangeLog
mono/mini/mini.c

index b61af0073187f31535d25cd4e1be95946135a26e..ea634ca9aab29c38516df16bba061ea57f16be5b 100644 (file)
@@ -1,5 +1,9 @@
 2008-08-28  Zoltan Varga  <vargaz@gmail.com>
 
+       * mini.c: Avoid not initializing the runtime when doing AOT compilation, 
+       since too many things depend on it. Instead, call 
+       mono_runtime_set_no_exec ().
+       
        * mini.c (mono_create_tls_get): Call mono_alloc_preg (cfg) when running with
        the new JIT.
 
index 56aae64ce309b4915d7e96d213f7cdc0bff48ff3..ce23ded4aa5a8bde7b43886e687416bad25f983d 100644 (file)
@@ -14587,17 +14587,18 @@ mini_init (const char *filename, const char *runtime_version)
 
        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 ();
@@ -14720,8 +14721,7 @@ mini_cleanup (MonoDomain *domain)
        /* 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 ();