diff options
author | Bill Buzbee <buzbee@google.com> | 2009-11-20 15:41:34 -0800 |
---|---|---|
committer | Bill Buzbee <buzbee@google.com> | 2009-11-23 09:57:56 -0800 |
commit | ce46c9456590968db896b5f6e63509a70232044c (patch) | |
tree | c21c5be5f817eaeb06711d2faa24781a2e16ba97 /vm/compiler/codegen/arm/CodegenDriver.c | |
parent | f9f33287693f9f9aa44318036b8aab627bd21a32 (diff) | |
download | android_dalvik-ce46c9456590968db896b5f6e63509a70232044c.tar.gz android_dalvik-ce46c9456590968db896b5f6e63509a70232044c.tar.bz2 android_dalvik-ce46c9456590968db896b5f6e63509a70232044c.zip |
Jit: Support for inline-execute/range [issue 2268232]
Diffstat (limited to 'vm/compiler/codegen/arm/CodegenDriver.c')
-rw-r--r-- | vm/compiler/codegen/arm/CodegenDriver.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/vm/compiler/codegen/arm/CodegenDriver.c b/vm/compiler/codegen/arm/CodegenDriver.c index 35460ed01..37fd65fdb 100644 --- a/vm/compiler/codegen/arm/CodegenDriver.c +++ b/vm/compiler/codegen/arm/CodegenDriver.c @@ -3289,15 +3289,14 @@ static bool genInlinedIndexOf(CompilationUnit *cUnit, MIR *mir, bool singleI) /* - * NOTE: We assume here that the special native inline routines - * are side-effect free. By making this assumption, we can safely - * re-execute the routine from the interpreter if it decides it - * wants to throw an exception. We still need to EXPORT_PC(), though. + * NOTE: Handles both range and non-range versions (arguments + * have already been normalized by this point). */ -static bool handleFmt3inline(CompilationUnit *cUnit, MIR *mir) +static bool handleExecuteInline(CompilationUnit *cUnit, MIR *mir) { DecodedInstruction *dInsn = &mir->dalvikInsn; switch( mir->dalvikInsn.opCode) { + case OP_EXECUTE_INLINE_RANGE: case OP_EXECUTE_INLINE: { unsigned int i; const InlineOperation* inLineTable = dvmGetInlineOpsTable(); @@ -3370,7 +3369,14 @@ static bool handleFmt3inline(CompilationUnit *cUnit, MIR *mir) } opReg(cUnit, kOpBlx, r4PC); opRegImm(cUnit, kOpAdd, r13, 8); - genZeroCheck(cUnit, r0, mir->offset, NULL); + opRegImm(cUnit, kOpCmp, r0, 0); /* NULL? */ + ArmLIR *branchOver = opCondBranch(cUnit, kArmCondNe); + loadConstant(cUnit, r0, + (int) (cUnit->method->insns + mir->offset)); + genDispatchToHandler(cUnit, TEMPLATE_THROW_EXCEPTION_COMMON); + ArmLIR *target = newLIR0(cUnit, kArmPseudoTargetLabel); + target->defMask = ENCODE_ALL; + branchOver->generic.target = (LIR *) target; break; } default: @@ -3379,13 +3385,6 @@ static bool handleFmt3inline(CompilationUnit *cUnit, MIR *mir) return false; } -static bool handleFmt3rinline(CompilationUnit *cUnit, MIR *mir) -{ - /* For OP_EXECUTE_INLINE_RANGE */ - genInterpSingleStep(cUnit, mir); - return false; -} - static bool handleFmt51l(CompilationUnit *cUnit, MIR *mir) { //TUNING: We're using core regs here - not optimal when target is a double @@ -3955,10 +3954,8 @@ void dvmCompilerMIR2LIR(CompilationUnit *cUnit) labelList); break; case kFmt3inline: - notHandled = handleFmt3inline(cUnit, mir); - break; case kFmt3rinline: - notHandled = handleFmt3rinline(cUnit, mir); + notHandled = handleExecuteInline(cUnit, mir); break; case kFmt51l: notHandled = handleFmt51l(cUnit, mir); |