aboutsummaryrefslogtreecommitdiff
path: root/vm/compiler/codegen/arm/CodegenDriver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'vm/compiler/codegen/arm/CodegenDriver.cpp')
-rw-r--r--vm/compiler/codegen/arm/CodegenDriver.cpp32
1 files changed, 25 insertions, 7 deletions
diff --git a/vm/compiler/codegen/arm/CodegenDriver.cpp b/vm/compiler/codegen/arm/CodegenDriver.cpp
index 40fc96480..7346c835e 100644
--- a/vm/compiler/codegen/arm/CodegenDriver.cpp
+++ b/vm/compiler/codegen/arm/CodegenDriver.cpp
@@ -670,6 +670,7 @@ static bool genArithOpLong(CompilationUnit *cUnit, MIR *mir,
OpKind firstOp = kOpBkpt;
OpKind secondOp = kOpBkpt;
bool callOut = false;
+ bool checkZero = false;
void *callTgt;
int retReg = r0;
@@ -700,6 +701,7 @@ static bool genArithOpLong(CompilationUnit *cUnit, MIR *mir,
case OP_DIV_LONG_2ADDR:
callOut = true;
retReg = r0;
+ checkZero = true;
callTgt = (void*)__aeabi_ldivmod;
break;
/* NOTE - result is in r2/r3 instead of r0/r1 */
@@ -708,6 +710,7 @@ static bool genArithOpLong(CompilationUnit *cUnit, MIR *mir,
callOut = true;
callTgt = (void*)__aeabi_ldivmod;
retReg = r2;
+ checkZero = true;
break;
case OP_AND_LONG_2ADDR:
case OP_AND_LONG:
@@ -746,9 +749,14 @@ static bool genArithOpLong(CompilationUnit *cUnit, MIR *mir,
} else {
// Adjust return regs in to handle case of rem returning r2/r3
dvmCompilerFlushAllRegs(cUnit); /* Send everything to home location */
+ loadValueDirectWideFixed(cUnit, rlSrc2, r2, r3);
loadValueDirectWideFixed(cUnit, rlSrc1, r0, r1);
LOAD_FUNC_ADDR(cUnit, r14lr, (int) callTgt);
- loadValueDirectWideFixed(cUnit, rlSrc2, r2, r3);
+ if (checkZero) {
+ int tReg = r12; // Using fixed registers during call sequence
+ opRegRegReg(cUnit, kOpOr, tReg, r2, r3);
+ genRegImmCheck(cUnit, kArmCondEq, tReg, 0, mir->offset, NULL);
+ }
opReg(cUnit, kOpBlx, r14lr);
dvmCompilerClobberCallRegs(cUnit);
if (retReg == r0)
@@ -3637,30 +3645,40 @@ static bool handleExecuteInline(CompilationUnit *cUnit, MIR *mir)
return false; /* Nop */
/* These ones we potentially JIT inline. */
+
+ case INLINE_STRING_CHARAT:
+ return genInlinedStringCharAt(cUnit, mir);
case INLINE_STRING_LENGTH:
return genInlinedStringLength(cUnit, mir);
case INLINE_STRING_IS_EMPTY:
return genInlinedStringIsEmpty(cUnit, mir);
+ case INLINE_STRING_COMPARETO:
+ return genInlinedCompareTo(cUnit, mir);
+ case INLINE_STRING_FASTINDEXOF_II:
+ return genInlinedFastIndexOf(cUnit, mir);
+
case INLINE_MATH_ABS_INT:
+ case INLINE_STRICT_MATH_ABS_INT:
return genInlinedAbsInt(cUnit, mir);
case INLINE_MATH_ABS_LONG:
+ case INLINE_STRICT_MATH_ABS_LONG:
return genInlinedAbsLong(cUnit, mir);
case INLINE_MATH_MIN_INT:
+ case INLINE_STRICT_MATH_MIN_INT:
return genInlinedMinMaxInt(cUnit, mir, true);
case INLINE_MATH_MAX_INT:
+ case INLINE_STRICT_MATH_MAX_INT:
return genInlinedMinMaxInt(cUnit, mir, false);
- case INLINE_STRING_CHARAT:
- return genInlinedStringCharAt(cUnit, mir);
case INLINE_MATH_SQRT:
+ case INLINE_STRICT_MATH_SQRT:
return genInlineSqrt(cUnit, mir);
case INLINE_MATH_ABS_FLOAT:
+ case INLINE_STRICT_MATH_ABS_FLOAT:
return genInlinedAbsFloat(cUnit, mir);
case INLINE_MATH_ABS_DOUBLE:
+ case INLINE_STRICT_MATH_ABS_DOUBLE:
return genInlinedAbsDouble(cUnit, mir);
- case INLINE_STRING_COMPARETO:
- return genInlinedCompareTo(cUnit, mir);
- case INLINE_STRING_FASTINDEXOF_II:
- return genInlinedFastIndexOf(cUnit, mir);
+
case INLINE_FLOAT_TO_RAW_INT_BITS:
case INLINE_INT_BITS_TO_FLOAT:
return genInlinedIntFloatConversion(cUnit, mir);