diff options
author | buzbee <buzbee@google.com> | 2010-08-31 10:16:35 -0700 |
---|---|---|
committer | buzbee <buzbee@google.com> | 2010-08-31 12:04:20 -0700 |
commit | 8f8109ade5c32c8c94fa6b7c058045733c8c5ad1 (patch) | |
tree | 8fbbd48c41312e51784406cb17c1c36a962c4604 /vm/compiler/codegen/arm/Thumb2 | |
parent | c842a1d3ac530af7b5733aa83ad15495cd359ff0 (diff) | |
download | android_dalvik-8f8109ade5c32c8c94fa6b7c058045733c8c5ad1.tar.gz android_dalvik-8f8109ade5c32c8c94fa6b7c058045733c8c5ad1.tar.bz2 android_dalvik-8f8109ade5c32c8c94fa6b7c058045733c8c5ad1.zip |
JIT: Add new compare-immed-and-branch primative & drop useless clrex
This allows better use of cbz/cbnz on Thumb2 targets. Also, removed
the clrex from the inline monitor enter code (not necessary).
Change-Id: I3bfa90bcdf34f6ef3e2447c9c6f1b49a98a89e58
Diffstat (limited to 'vm/compiler/codegen/arm/Thumb2')
-rw-r--r-- | vm/compiler/codegen/arm/Thumb2/Factory.c | 12 | ||||
-rw-r--r-- | vm/compiler/codegen/arm/Thumb2/Gen.c | 9 |
2 files changed, 7 insertions, 14 deletions
diff --git a/vm/compiler/codegen/arm/Thumb2/Factory.c b/vm/compiler/codegen/arm/Thumb2/Factory.c index 2bf294001..5074e425b 100644 --- a/vm/compiler/codegen/arm/Thumb2/Factory.c +++ b/vm/compiler/codegen/arm/Thumb2/Factory.c @@ -1088,15 +1088,13 @@ static void loadPair(CompilationUnit *cUnit, int base, int lowReg, int highReg) loadBaseDispWide(cUnit, NULL, base, 0, lowReg, highReg, INVALID_SREG); } - /* - * Perform a "reg cmp imm" operation and jump to the PCR region if condition - * satisfies. + * Generate a register comparison to an immediate and branch. Caller + * is responsible for setting branch target field. */ -static ArmLIR *genRegImmCheck(CompilationUnit *cUnit, +static ArmLIR *genCmpImmBranch(CompilationUnit *cUnit, ArmConditionCode cond, int reg, - int checkValue, int dOffset, - ArmLIR *pcrLabel) + int checkValue) { ArmLIR *branch; int modImm; @@ -1118,7 +1116,7 @@ static ArmLIR *genRegImmCheck(CompilationUnit *cUnit, } branch = newLIR2(cUnit, kThumbBCond, 0, cond); } - return genCheckCommon(cUnit, dOffset, branch, pcrLabel); + return branch; } static ArmLIR *fpRegCopy(CompilationUnit *cUnit, int rDest, int rSrc) diff --git a/vm/compiler/codegen/arm/Thumb2/Gen.c b/vm/compiler/codegen/arm/Thumb2/Gen.c index 36323880b..8858bb01e 100644 --- a/vm/compiler/codegen/arm/Thumb2/Gen.c +++ b/vm/compiler/codegen/arm/Thumb2/Gen.c @@ -220,11 +220,6 @@ static void genMonitorEnter(CompilationUnit *cUnit, MIR *mir) hopTarget->defMask = ENCODE_ALL; hopBranch->generic.target = (LIR *)hopTarget; - // Clear the lock - ArmLIR *inst = newLIR0(cUnit, kThumb2Clrex); - // ...and make it a scheduling barrier - inst->defMask = ENCODE_ALL; - // Export PC (part 1) loadConstant(cUnit, r3, (int) (cUnit->method->insns + mir->offset)); @@ -290,8 +285,8 @@ static void genMonitorExit(CompilationUnit *cUnit, MIR *mir) sizeof(StackSaveArea) - offsetof(StackSaveArea, xtra.currentPc)); opReg(cUnit, kOpBlx, r7); - opRegImm(cUnit, kOpCmp, r0, 0); /* Did we throw? */ - ArmLIR *branchOver = opCondBranch(cUnit, kArmCondNe); + /* Did we throw? */ + ArmLIR *branchOver = genCmpImmBranch(cUnit, kArmCondNe, r0, 0); loadConstant(cUnit, r0, (int) (cUnit->method->insns + mir->offset + dexGetInstrWidthAbs(gDvm.instrWidth, OP_MONITOR_EXIT))); |