From a7c12688da57ea052e127776ad3043ca5079488d Mon Sep 17 00:00:00 2001 From: buzbee Date: Mon, 19 Mar 2012 13:13:53 -0700 Subject: 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 --- src/compiler/codegen/RallocUtil.cc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/compiler/codegen/RallocUtil.cc') 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]; -- cgit v1.2.3-59-g8ed1b