OSDN Git Service

Do not initialize the JIT if it is not the designated execution mode.
authorBen Cheng <bccheng@google.com>
Fri, 9 Oct 2009 18:55:30 +0000 (11:55 -0700)
committerBen Cheng <bccheng@google.com>
Fri, 9 Oct 2009 19:00:23 +0000 (12:00 -0700)
vm/Init.c

index 0710a55..7f83bc5 100644 (file)
--- a/vm/Init.c
+++ b/vm/Init.c
@@ -1368,8 +1368,10 @@ bool dvmInitAfterZygote(void)
         (int)(endJdwp-startJdwp), (int)(endJdwp-startHeap));
 
 #ifdef WITH_JIT
-    if (!dvmJitStartup())
-        return false;
+    if (gDvm.executionMode == kExecutionModeJit) {
+        if (!dvmJitStartup())
+            return false;
+    }
 #endif
 
     return true;
@@ -1558,8 +1560,10 @@ void dvmShutdown(void)
     dvmStdioConverterShutdown();
 
 #ifdef WITH_JIT
-    /* tell the compiler to shut down if it was started */
-    dvmJitShutdown();
+    if (gDvm.executionMode == kExecutionModeJit) {
+        /* shut down the compiler thread */
+        dvmJitShutdown();
+    }
 #endif
 
     /*