OSDN Git Service

Suppress warning if JIT disabled
authorbuzbee <buzbee@google.com>
Sun, 21 Jul 2013 18:45:37 +0000 (11:45 -0700)
committerbuzbee <buzbee@google.com>
Sun, 21 Jul 2013 18:45:37 +0000 (11:45 -0700)
Setting gDvmJit.code_cache_size=0 disables the JIT, but also
causes a warning.  This change disables the JIT earlier in the
startup process, avoiding the warning.

Change-Id: Id6acd32dc0067218d503add90119008c953c4ea5

vm/Init.cpp

index 96171b0..d5b4989 100644 (file)
@@ -1123,6 +1123,9 @@ static int processOptions(int argc, const char* const argv[],
           gDvmJit.threshold = atoi(argv[i] + 15);
         } else if (strncmp(argv[i], "-Xjitcodecachesize:", 19) == 0) {
           gDvmJit.codeCacheSize = atoi(argv[i] + 19) * 1024;
+          if (gDvmJit.codeCacheSize == 0) {
+            gDvm.executionMode = kExecutionModeInterpFast;
+          }
         } else if (strncmp(argv[i], "-Xincludeselectedop", 19) == 0) {
           gDvmJit.includeSelectedOp = true;
         } else if (strncmp(argv[i], "-Xincludeselectedmethod", 23) == 0) {