am 64520c8c: Merge change 21796 into eclair

Merge commit '64520c8c453b03190e33818306ffed3041133ea3'

* commit '64520c8c453b03190e33818306ffed3041133ea3':
  Turn down RegisterMap paranoia.
diff --git a/vm/Dvm.mk b/vm/Dvm.mk
index 7aab98d..2aee9d0 100644
--- a/vm/Dvm.mk
+++ b/vm/Dvm.mk
@@ -192,16 +192,13 @@
 	test/TestHash.c \
 	test/TestIndirectRefTable.c
 
-ifeq ($(WITH_JIT_TUNING),true)
-  LOCAL_CFLAGS += -DWITH_JIT_TUNING
-endif
+WITH_JIT := $(strip $(WITH_JIT))
 
 ifeq ($(WITH_JIT),true)
-  # NOTE: Turn on assertion for JIT for now
-  LOCAL_CFLAGS += -DWITH_DALVIK_ASSERT
-  # NOTE: Also turn on tuning when JIT is enabled for now
-  LOCAL_CFLAGS += -DWITH_JIT_TUNING
   LOCAL_CFLAGS += -DWITH_JIT
+  # Enable assert and JIT_TUNING for now
+  LOCAL_CFLAGS += -UNDEBUG -DDEBUG=1 -DLOG_NDEBUG=1 -DWITH_DALVIK_ASSERT
+  WITH_JIT_TUNING := true
   LOCAL_SRC_FILES += \
 	../dexdump/OpCodeNames.c \
 	compiler/Compiler.c \
@@ -211,6 +208,10 @@
 	interp/Jit.c
 endif
 
+ifeq ($(strip $(WITH_JIT_TUNING)),true)
+  LOCAL_CFLAGS += -DWITH_JIT_TUNING
+endif
+
 WITH_HPROF := $(strip $(WITH_HPROF))
 ifeq ($(WITH_HPROF),)
   WITH_HPROF := true
diff --git a/vm/compiler/codegen/arm/Codegen.c b/vm/compiler/codegen/arm/Codegen.c
index 7d127f8..b6c266d 100644
--- a/vm/compiler/codegen/arm/Codegen.c
+++ b/vm/compiler/codegen/arm/Codegen.c
@@ -1154,8 +1154,7 @@
     ArmLIR *retChainingCell = &labelList[bb->fallThrough->id];
 
     /* r1 = &retChainingCell */
-    ArmLIR *addrRetChain = newLIR3(cUnit, THUMB_ADD_PC_REL,
-                                           r1, 0, 0);
+    ArmLIR *addrRetChain = newLIR3(cUnit, THUMB_ADD_PC_REL, r1, 0, 0);
     /* r4PC = dalvikCallsite */
     loadConstant(cUnit, r4PC,
                  (int) (cUnit->method->insns + mir->offset));
@@ -1215,13 +1214,11 @@
                  (int) (cUnit->method->insns + mir->offset));
 
     /* r1 = &retChainingCell */
-    ArmLIR *addrRetChain = newLIR2(cUnit, THUMB_ADD_PC_REL,
-                                       r1, 0);
+    ArmLIR *addrRetChain = newLIR3(cUnit, THUMB_ADD_PC_REL, r1, 0, 0);
     addrRetChain->generic.target = (LIR *) retChainingCell;
 
     /* r2 = &predictedChainingCell */
-    ArmLIR *predictedChainingCell =
-        newLIR2(cUnit, THUMB_ADD_PC_REL, r2, 0);
+    ArmLIR *predictedChainingCell = newLIR3(cUnit, THUMB_ADD_PC_REL, r2, 0, 0);
     predictedChainingCell->generic.target = (LIR *) predChainingCell;
 
     genDispatchToHandler(cUnit, TEMPLATE_INVOKE_METHOD_PREDICTED_CHAIN);
@@ -2608,13 +2605,12 @@
                          (int) (cUnit->method->insns + mir->offset));
 
             /* r1 = &retChainingCell */
-            ArmLIR *addrRetChain = newLIR2(cUnit, THUMB_ADD_PC_REL,
-                                               r1, 0);
+            ArmLIR *addrRetChain = newLIR3(cUnit, THUMB_ADD_PC_REL, r1, 0, 0);
             addrRetChain->generic.target = (LIR *) retChainingCell;
 
             /* r2 = &predictedChainingCell */
             ArmLIR *predictedChainingCell =
-                newLIR2(cUnit, THUMB_ADD_PC_REL, r2, 0);
+                newLIR3(cUnit, THUMB_ADD_PC_REL, r2, 0, 0);
             predictedChainingCell->generic.target = (LIR *) predChainingCell;
 
             genDispatchToHandler(cUnit, TEMPLATE_INVOKE_METHOD_PREDICTED_CHAIN);
diff --git a/vm/interp/Jit.c b/vm/interp/Jit.c
index 2bcb1f5..9079da1 100644
--- a/vm/interp/Jit.c
+++ b/vm/interp/Jit.c
@@ -45,8 +45,9 @@
     if (res && gDvm.executionMode == kExecutionModeJit) {
         JitEntry *pJitTable = NULL;
         unsigned char *pJitProfTable = NULL;
-        assert(gDvm.jitTableSize &&
-            !(gDvm.jitTableSize & (gDvmJit.jitTableSize - 1))); // Power of 2?
+        // Power of 2?
+        assert(gDvmJit.jitTableSize &&
+               !(gDvmJit.jitTableSize & (gDvmJit.jitTableSize - 1)));
         dvmLockMutex(&gDvmJit.tableLock);
         pJitTable = (JitEntry*)
                     calloc(gDvmJit.jitTableSize, sizeof(*pJitTable));
@@ -74,7 +75,7 @@
            pJitTable[i].u.info.chain = gDvmJit.jitTableSize;
         }
         /* Is chain field wide enough for termination pattern? */
-        assert(pJitTable[0].u.info.chain == gDvm.maxJitTableEntries);
+        assert(pJitTable[0].u.info.chain == gDvmJit.jitTableSize);
 
 done:
         gDvmJit.pJitEntryTable = pJitTable;
@@ -603,7 +604,7 @@
     unsigned int oldSize;
     unsigned int i;
 
-    assert(gDvm.pJitEntryTable != NULL);
+    assert(gDvmJit.pJitEntryTable != NULL);
     assert(size && !(size & (size - 1)));   /* Is power of 2? */
 
     LOGD("Jit: resizing JitTable from %d to %d", gDvmJit.jitTableSize, size);