diff options
| author | 2011-10-10 09:35:02 -0700 | |
|---|---|---|
| committer | 2011-10-10 09:35:02 -0700 | |
| commit | fe2e17f424584ad6969c6fcf7cf6364c69355d53 (patch) | |
| tree | ad4b5837bcc7f2d346adbe5b8aff46833d0aa1a8 /src/compiler/codegen | |
| parent | bf7dca57e51e85a647c63cec984048ca03c5f071 (diff) | |
Simplify compiler's suspend check mechanism.
Move to a single mechanism for suspend checks. Previously backwards
branches only checked the suspend count when an internal counter
reached zero, while returns always checked. Now all checks use
the counter.
Change-Id: Ibca2881e102babbd134bb9b41d798e9e4a3b522c
Diffstat (limited to 'src/compiler/codegen')
| -rw-r--r-- | src/compiler/codegen/arm/MethodCodegenDriver.cc | 6 | ||||
| -rw-r--r-- | src/compiler/codegen/arm/Thumb2/Gen.cc | 22 |
2 files changed, 3 insertions, 25 deletions
diff --git a/src/compiler/codegen/arm/MethodCodegenDriver.cc b/src/compiler/codegen/arm/MethodCodegenDriver.cc index fb665e68fa..633125443b 100644 --- a/src/compiler/codegen/arm/MethodCodegenDriver.cc +++ b/src/compiler/codegen/arm/MethodCodegenDriver.cc @@ -1169,17 +1169,17 @@ STATIC bool compileDalvikInstruction(CompilationUnit* cUnit, MIR* mir, break; case OP_RETURN_VOID: - genSuspendPoll(cUnit, mir); + genSuspendTest(cUnit, mir); break; case OP_RETURN: case OP_RETURN_OBJECT: - genSuspendPoll(cUnit, mir); + genSuspendTest(cUnit, mir); storeValue(cUnit, getRetLoc(cUnit), rlSrc[0]); break; case OP_RETURN_WIDE: - genSuspendPoll(cUnit, mir); + genSuspendTest(cUnit, mir); storeValueWide(cUnit, getRetLocWide(cUnit), rlSrc[0]); break; diff --git a/src/compiler/codegen/arm/Thumb2/Gen.cc b/src/compiler/codegen/arm/Thumb2/Gen.cc index c1366607b2..094d10c498 100644 --- a/src/compiler/codegen/arm/Thumb2/Gen.cc +++ b/src/compiler/codegen/arm/Thumb2/Gen.cc @@ -1789,28 +1789,6 @@ STATIC void genSuspendTest(CompilationUnit* cUnit, MIR* mir) oatInsertGrowableList(&cUnit->suspendLaunchpads, (intptr_t)target); } -/* Check for pending suspend request. */ -STATIC void genSuspendPoll(CompilationUnit* cUnit, MIR* mir) -{ - if (NO_SUSPEND || mir->optimizationFlags & MIR_IGNORE_SUSPEND_CHECK) { - return; - } - oatFlushAllRegs(cUnit); - oatLockCallTemps(cUnit); // Explicit register usage - int rSuspendCount = r1; - ArmLIR* ld; - ld = loadWordDisp(cUnit, rSELF, - art::Thread::SuspendCountOffset().Int32Value(), rSuspendCount); - setMemRefType(ld, true /* isLoad */, kMustNotAlias); - loadWordDisp(cUnit, rSELF, - OFFSETOF_MEMBER(Thread, pCheckSuspendFromCode), rLR); - genRegCopy(cUnit, r0, rSELF); - opRegImm(cUnit, kOpCmp, rSuspendCount, 0); - genIT(cUnit, kArmCondNe, ""); - opReg(cUnit, kOpBlx, rLR); - oatFreeCallTemps(cUnit); -} - /* * The following are the first-level codegen routines that analyze the format * of each bytecode then either dispatch special purpose codegen routines |