diff options
| author | 2012-03-19 13:13:53 -0700 | |
|---|---|---|
| committer | 2012-03-19 13:17:53 -0700 | |
| commit | a7c12688da57ea052e127776ad3043ca5079488d (patch) | |
| tree | a34c72a35f260e0680a486e3b98e7965dfcdc687 /src/compiler/codegen/RallocUtil.cc | |
| parent | b3ab25b58945f1bd22da1be2eb49dc3eb121011e (diff) | |
Restore card marking, minor tuning
Restore GC card marks that were mistakenly dropped during an
earlier retructuring. Add debugging to code to gather opcode
frequency statics. Minor tuning for code size.
Change-Id: I117f62c29e29250277166e7f005706e27998f77a
Diffstat (limited to 'src/compiler/codegen/RallocUtil.cc')
| -rw-r--r-- | src/compiler/codegen/RallocUtil.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/compiler/codegen/RallocUtil.cc b/src/compiler/codegen/RallocUtil.cc index ffff7d231c..b3fa739d0e 100644 --- a/src/compiler/codegen/RallocUtil.cc +++ b/src/compiler/codegen/RallocUtil.cc @@ -1100,6 +1100,7 @@ extern void oatDoPromotion(CompilationUnit* cUnit) int regBias = cUnit->numCompilerTemps + 1; int dalvikRegs = cUnit->numDalvikRegisters; int numRegs = dalvikRegs + regBias; + const int promotionThreshold = 2; // Allow target code to add any special registers oatAdjustSpillMask(cUnit); @@ -1164,7 +1165,8 @@ extern void oatDoPromotion(CompilationUnit* cUnit) if (!(cUnit->disableOpt & (1 << kPromoteRegs))) { // Promote fpRegs - for (int i = 0; (i < numRegs) && (fpRegs[i].count > 0); i++) { + for (int i = 0; (i < numRegs) && + (fpRegs[i].count >= promotionThreshold ); i++) { int pMapIdx = SRegToPMap(cUnit, fpRegs[i].sReg); if (cUnit->promotionMap[pMapIdx].fpLocation != kLocPhysReg) { int reg = oatAllocPreservedFPReg(cUnit, fpRegs[i].sReg, @@ -1176,7 +1178,8 @@ extern void oatDoPromotion(CompilationUnit* cUnit) } // Promote core regs - for (int i = 0; (i < numRegs) && (coreRegs[i].count > 0); i++) { + for (int i = 0; (i < numRegs) && + (coreRegs[i].count > promotionThreshold); i++) { int pMapIdx = SRegToPMap(cUnit, coreRegs[i].sReg); if (cUnit->promotionMap[pMapIdx].coreLocation != kLocPhysReg) { @@ -1186,8 +1189,17 @@ extern void oatDoPromotion(CompilationUnit* cUnit) } } } + } else if (cUnit->qdMode) { + oatAllocPreservedCoreReg(cUnit, cUnit->methodSReg); + for (int i = 0; i < numRegs; i++) { + int reg = oatAllocPreservedCoreReg(cUnit, i); + if (reg < 0) { + break; // No more left + } + } } + // Now, update SSA names to new home locations for (int i = 0; i < cUnit->numSSARegs; i++) { RegLocation *curr = &cUnit->regLocation[i]; |