diff options
| author | 2012-03-18 13:24:07 -0700 | |
|---|---|---|
| committer | 2012-03-18 18:17:16 -0700 | |
| commit | 9c044ce5f76e9bfa17c4c1979e9f8c99ae100695 (patch) | |
| tree | 6eefdf59583cd75f1e77814b85bbf1222addd395 /src/compiler/codegen/GenInvoke.cc | |
| parent | 3fa13791c51985d9956d01bc465de6d36c3390d3 (diff) | |
Support for promoting Method* and compiler temps
This CL completes the support for allowing compiler-generated
data to be treated as a Dalvik register and become subject to
the normal register promotion and live temp tracking machinery.
Also:
o Removes some vestigal and useless Method* loads from
range argument setup.
o Changes the Method* pseudo vReg number from -1 to -2 to
avoid a conflict with the 0xffff marker in the register map.
o Removes some experimental code for CSE at the basic block
level.
Change-Id: I112a8bbe20f95a8d789f63908c84e5fa167c74ac
Diffstat (limited to 'src/compiler/codegen/GenInvoke.cc')
| -rw-r--r-- | src/compiler/codegen/GenInvoke.cc | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/compiler/codegen/GenInvoke.cc b/src/compiler/codegen/GenInvoke.cc index 90e2267a5f..c2023ff113 100644 --- a/src/compiler/codegen/GenInvoke.cc +++ b/src/compiler/codegen/GenInvoke.cc @@ -33,6 +33,23 @@ typedef int (*NextCallInsn)(CompilationUnit*, MIR*, int, uint32_t dexIdx, */ void flushIns(CompilationUnit* cUnit) { + /* + * Dummy up a RegLocation for the incoming Method* + * It will attempt to keep rARG0 live (or copy it to home location + * if promoted). + */ + RegLocation rlSrc = cUnit->regLocation[cUnit->methodSReg]; + RegLocation rlMethod = cUnit->regLocation[cUnit->methodSReg]; + rlSrc.location = kLocPhysReg; + rlSrc.lowReg = rARG0; + rlSrc.home = false; + oatMarkLive(cUnit, rlSrc.lowReg, rlSrc.sRegLow); + storeValue(cUnit, rlMethod, rlSrc); + // If Method* has been promoted, explicitly flush + if (rlMethod.location == kLocPhysReg) { + storeWordDisp(cUnit, rSP, 0, rARG0); + } + if (cUnit->numIns == 0) return; int firstArgReg = rARG1; @@ -161,6 +178,7 @@ int nextSDCallInsn(CompilationUnit* cUnit, MIR* mir, } else { switch(state) { case 0: // Get the current Method* [sets rARG0] + // TUNING: we can save a reg copy if Method* has been promoted loadCurrMethodDirect(cUnit, rARG0); break; case 1: // Get method->dex_cache_resolved_methods_ @@ -537,8 +555,6 @@ int genDalvikArgsRange(CompilationUnit* cUnit, MIR* mir, opRegRegImm(cUnit, kOpAdd, rARG1, rSP, startOffset); callRuntimeHelperRegRegImm(cUnit, OFFSETOF_MEMBER(Thread, pMemcpy), rARG0, rARG1, (numArgs - 3) * 4); - // Restore Method* - loadCurrMethodDirect(cUnit, rARG0); #else if (numArgs >= 20) { // Generate memcpy @@ -546,8 +562,6 @@ int genDalvikArgsRange(CompilationUnit* cUnit, MIR* mir, opRegRegImm(cUnit, kOpAdd, rARG1, rSP, startOffset); callRuntimeHelperRegRegImm(cUnit, OFFSETOF_MEMBER(Thread, pMemcpy), rARG0, rARG1, (numArgs - 3) * 4); - // Restore Method* - loadCurrMethodDirect(cUnit, rARG0); } else { // Use vldm/vstm pair using rARG3 as a temp int regsLeft = std::min(numArgs - 3, 16); |