Merge "Add -Xcheck:jni." into dalvik-dev
diff --git a/src/compiler/codegen/Ralloc.h b/src/compiler/codegen/Ralloc.h
index ec72039..b73ae30 100644
--- a/src/compiler/codegen/Ralloc.h
+++ b/src/compiler/codegen/Ralloc.h
@@ -168,7 +168,7 @@
 extern RegisterInfo *oatIsLive(CompilationUnit* cUnit, int reg);
 
 /* To be used when explicitly managing register use */
-extern void oatLockAllTemps(CompilationUnit* cUnit);
+extern void oatLockCallTemps(CompilationUnit* cUnit);
 
 extern void oatFlushAllRegs(CompilationUnit* cUnit);
 
diff --git a/src/compiler/codegen/RallocUtil.cc b/src/compiler/codegen/RallocUtil.cc
index 492c79a..6a9777e 100644
--- a/src/compiler/codegen/RallocUtil.cc
+++ b/src/compiler/codegen/RallocUtil.cc
@@ -713,13 +713,13 @@
 }
 
 /* To be used when explicitly managing register use */
-extern void oatLockAllTemps(CompilationUnit* cUnit)
+extern void oatLockCallTemps(CompilationUnit* cUnit)
 {
-    int i;
-    for (i=0; i< cUnit->regPool->numCoreRegs; i++) {
-        if (cUnit->regPool->coreRegs[i].isTemp)
-            oatLockTemp(cUnit, cUnit->regPool->coreRegs[i].reg);
-    }
+    //TODO: Arm specific - move to target dependent code
+    oatLockTemp(cUnit, r0);
+    oatLockTemp(cUnit, r1);
+    oatLockTemp(cUnit, r2);
+    oatLockTemp(cUnit, r3);
 }
 
 // Make sure nothing is live and dirty
diff --git a/src/compiler/codegen/arm/MethodCodegenDriver.cc b/src/compiler/codegen/arm/MethodCodegenDriver.cc
index ea02721..c4b30b2 100644
--- a/src/compiler/codegen/arm/MethodCodegenDriver.cc
+++ b/src/compiler/codegen/arm/MethodCodegenDriver.cc
@@ -693,7 +693,7 @@
     if (dInsn->vA == 0)
         return callState;
 
-    oatLockAllTemps(cUnit);
+    oatLockCallTemps(cUnit);
     callState = nextCallInsn(cUnit, mir, dInsn, callState);
 
     /*
@@ -816,7 +816,7 @@
 
     // Finally, deal with the register arguments
     // We'll be using fixed registers here
-    oatLockAllTemps(cUnit);
+    oatLockCallTemps(cUnit);
     callState = nextCallInsn(cUnit, mir, dInsn, callState);
     return callState;
 }
diff --git a/src/compiler/codegen/arm/Thumb2/Gen.cc b/src/compiler/codegen/arm/Thumb2/Gen.cc
index 16adae7..699a561 100644
--- a/src/compiler/codegen/arm/Thumb2/Gen.cc
+++ b/src/compiler/codegen/arm/Thumb2/Gen.cc
@@ -760,7 +760,7 @@
     oatFlushAllRegs(cUnit);
     assert(art::Monitor::kLwShapeThin == 0);
     loadValueDirectFixed(cUnit, rlSrc, r1);  // Get obj
-    oatLockAllTemps(cUnit);  // Prepare for explicit register usage
+    oatLockCallTemps(cUnit);  // Prepare for explicit register usage
     genNullCheck(cUnit, rlSrc.sRegLow, r1, mir->offset, NULL);
     loadWordDisp(cUnit, rSELF, Thread::IdOffset().Int32Value(), r3);
     newLIR3(cUnit, kThumb2Ldrex, r2, r1,
@@ -811,7 +811,7 @@
     assert(art::Monitor::kLwShapeThin == 0);
     oatFlushAllRegs(cUnit);
     loadValueDirectFixed(cUnit, rlSrc, r1);  // Get obj
-    oatLockAllTemps(cUnit);  // Prepare for explicit register usage
+    oatLockCallTemps(cUnit);  // Prepare for explicit register usage
     genNullCheck(cUnit, rlSrc.sRegLow, r1, mir->offset, NULL);
     loadWordDisp(cUnit, r1, OFFSETOF_MEMBER(Object, monitor_), r2); // Get lock
     loadWordDisp(cUnit, rSELF, Thread::IdOffset().Int32Value(), r3);