aboutsummaryrefslogtreecommitdiff
path: root/vm/compiler/codegen/arm/CodegenDriver.c
diff options
context:
space:
mode:
authorBill Buzbee <buzbee@google.com>2010-03-16 12:41:43 -0700
committerBill Buzbee <buzbee@google.com>2010-03-16 12:52:08 -0700
commit900a3afd0e8e0d88426b21447d601ee67e17b642 (patch)
tree727d1c15ed182f6c0f5471d7c49961a066ccfb8f /vm/compiler/codegen/arm/CodegenDriver.c
parentfcd1cbd456809d2a2c58644efb71e1f42810d3ab (diff)
Jit: Fix register usage bug - Issue 2518825 native crash running ARMv5te JIT
Change I8ca61804 added a call to dvmCanPutArrayElement for APUT_OBJECT, but did so in a way that violated register usage restrictions. This change tells the register allocation system what registers we expect to remain live across the call to dvmCanPutArrayElement. Change-Id: Icd83b888ba60768a196070d62d07d12c7a3c73c6
Diffstat (limited to 'vm/compiler/codegen/arm/CodegenDriver.c')
-rw-r--r--vm/compiler/codegen/arm/CodegenDriver.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/vm/compiler/codegen/arm/CodegenDriver.c b/vm/compiler/codegen/arm/CodegenDriver.c
index df0825a85..79a9fb3f8 100644
--- a/vm/compiler/codegen/arm/CodegenDriver.c
+++ b/vm/compiler/codegen/arm/CodegenDriver.c
@@ -565,6 +565,16 @@ static void genArrayObjectPut(CompilationUnit *cUnit, MIR *mir,
loadWordDisp(cUnit, r0, offsetof(Object, clazz), r0);
opReg(cUnit, kOpBlx, r2);
dvmCompilerClobberCallRegs(cUnit);
+
+ /*
+ * Using fixed registers here, and counting on r4 and r7 being
+ * preserved across the above call. Tell the register allocation
+ * utilities about the regs we are using directly
+ */
+ dvmCompilerLockTemp(cUnit, regPtr); // r4PC
+ dvmCompilerLockTemp(cUnit, regIndex); // r7
+ dvmCompilerLockTemp(cUnit, r0);
+
/* Bad? - roll back and re-execute if so */
genRegImmCheck(cUnit, kArmCondEq, r0, 0, mir->offset, pcrLabel);