OSDN Git Service

Turn down RegisterMap paranoia.
authorAndy McFadden <fadden@android.com>
Tue, 18 Aug 2009 22:11:35 +0000 (15:11 -0700)
committerAndy McFadden <fadden@android.com>
Tue, 18 Aug 2009 22:22:40 +0000 (15:22 -0700)
This disables verification of RegisterMap contents and compressed
output, as well as a GC-time check that double-checked the validity of a
register known to hold a reference.

For internal bug 1896437.

vm/Dvm.mk
vm/Init.c
vm/Thread.c
vm/analysis/RegisterMap.c

index 1280c17..7aab98d 100644 (file)
--- a/vm/Dvm.mk
+++ b/vm/Dvm.mk
@@ -86,7 +86,6 @@ else  # !dvm_make_debug_vm
   # "-O2" is redundant for device (release) but useful for sim (debug)
   #LOCAL_CFLAGS += -O2 -Winline
   #LOCAL_CFLAGS += -DWITH_EXTRA_OBJECT_VALIDATION
-  LOCAL_CFLAGS += -DWITH_EXTRA_GC_CHECKS=1
   LOCAL_CFLAGS += -DDVM_SHOW_EXCEPTION=1
   # if you want to try with assertions on the device, add:
   #LOCAL_CFLAGS += -UNDEBUG -DDEBUG=1 -DLOG_NDEBUG=1 -DWITH_DALVIK_ASSERT
index 4a2033e..45c66e1 100644 (file)
--- a/vm/Init.c
+++ b/vm/Init.c
@@ -932,7 +932,7 @@ static int dvmProcessOptions(int argc, const char* const argv[],
 
         } else if (strcmp(argv[i], "-Xgenregmap") == 0) {
             gDvm.generateRegisterMaps = true;
-            LOGD("Register maps will be generated during verification\n");
+            LOGV("Register maps will be generated during verification\n");
 
         } else if (strncmp(argv[i], "-Xgc:", 5) == 0) {
             if (strcmp(argv[i] + 5, "precise") == 0)
index e0f986d..3f63132 100644 (file)
@@ -3639,12 +3639,9 @@ static void gcScanInterpStackReferences(Thread *thread)
                  * if it's present -- but if it's enabled it means we're
                  * unexpectedly falling back on a conservative scan, so it's
                  * worth yelling a little.
-                 *
-                 * TODO: we should be able to remove this for production --
-                 * no need to keep banging on the global.
                  */
                 if (gDvm.preciseGc) {
-                    LOGV("PGC: no map for %s.%s\n",
+                    LOGVV("PGC: no map for %s.%s\n",
                         method->clazz->descriptor, method->name);
                 }
                 regVector = NULL;
index ad843d0..0e3445a 100644 (file)
@@ -30,7 +30,7 @@
 #include <stddef.h>
 
 /* double-check the compression */
-#define REGISTER_MAP_VERIFY     true
+#define REGISTER_MAP_VERIFY     false
 
 /* verbose logging */
 #define REGISTER_MAP_VERBOSE    false
@@ -270,10 +270,8 @@ RegisterMap* dvmGenerateRegisterMapV(VerifierData* vdata)
     LOGV("mapData=%p pMap=%p bufSize=%d\n", mapData, pMap, bufSize);
     assert(mapData - (const u1*) pMap == bufSize);
 
-#if 1
-    if (!verifyMap(vdata, pMap))
+    if (REGISTER_MAP_VERIFY && !verifyMap(vdata, pMap))
         goto bail;
-#endif
 #ifdef REGISTER_MAP_STATS
     computeMapStats(pMap, vdata->method);
 #endif