aboutsummaryrefslogtreecommitdiff
path: root/vm/compiler/codegen/arm/CodegenDriver.c
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2010-04-28 13:52:02 -0700
committerElliott Hughes <enh@google.com>2010-04-28 14:09:46 -0700
commitc7ad9b2542d5f1a491c9278c998697141ed2582a (patch)
tree25a3e0a8117db3ea19e241e4d319c6aef09b0fcb /vm/compiler/codegen/arm/CodegenDriver.c
parentc7b38fe8d622f9613ac51faa73cc3aa447ff826a (diff)
Don't accidentally convert % into /...
Fix a JIT bug I introduced the other day by not paying attention to the exact dalvik opcode being optimized. Change-Id: Ic0518645a5436e2903c2a34ef46d0205f23d571b
Diffstat (limited to 'vm/compiler/codegen/arm/CodegenDriver.c')
-rw-r--r--vm/compiler/codegen/arm/CodegenDriver.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/vm/compiler/codegen/arm/CodegenDriver.c b/vm/compiler/codegen/arm/CodegenDriver.c
index ef7de2822..c691d15b6 100644
--- a/vm/compiler/codegen/arm/CodegenDriver.c
+++ b/vm/compiler/codegen/arm/CodegenDriver.c
@@ -1900,9 +1900,12 @@ static int lowestSetBit(unsigned int x) {
// Returns true if it added instructions to 'cUnit' to divide 'rlSrc' by 'lit'
// and store the result in 'rlDest'.
-static bool handleEasyDivide(CompilationUnit *cUnit,
+static bool handleEasyDivide(CompilationUnit *cUnit, OpCode dalvikOpCode,
RegLocation rlSrc, RegLocation rlDest, int lit)
{
+ if (dalvikOpCode != OP_DIV_INT_LIT8 && dalvikOpCode != OP_DIV_INT_LIT16) {
+ return false;
+ }
if (lit < 2 || !isPowerOfTwo(lit)) {
return false;
}
@@ -2050,7 +2053,7 @@ static bool handleFmt22b_Fmt22s(CompilationUnit *cUnit, MIR *mir)
genInterpSingleStep(cUnit, mir);
return false;
}
- if (handleEasyDivide(cUnit, rlSrc, rlDest, lit)) {
+ if (handleEasyDivide(cUnit, dalvikOpCode, rlSrc, rlDest, lit)) {
return false;
}
dvmCompilerFlushAllRegs(cUnit); /* Everything to home location */