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
diff --git a/src/compiler/codegen/CodegenUtil.cc b/src/compiler/codegen/CodegenUtil.cc
index 8b324ed..d4b8eea 100644
--- a/src/compiler/codegen/CodegenUtil.cc
+++ b/src/compiler/codegen/CodegenUtil.cc
@@ -326,18 +326,29 @@
}
}
+#define BSZ 100
void oatDumpPromotionMap(CompilationUnit *cUnit)
{
- for (int i = 0; i < cUnit->numDalvikRegisters; i++) {
+ int numRegs = cUnit->numDalvikRegisters + cUnit->numCompilerTemps + 1;
+ for (int i = 0; i < numRegs; i++) {
PromotionMap vRegMap = cUnit->promotionMap[i];
- char buf[100];
+ char buf[BSZ];
if (vRegMap.fpLocation == kLocPhysReg) {
snprintf(buf, 100, " : s%d", vRegMap.fpReg & FP_REG_MASK);
} else {
buf[0] = 0;
}
- char buf2[100];
- snprintf(buf2, 100, "V[%02d] -> %s%d%s", i,
+ char buf2[BSZ];
+ char buf3[BSZ];
+ if (i < cUnit->numDalvikRegisters) {
+ snprintf(buf3, BSZ, "%02d", i);
+ } else if (i == cUnit->methodSReg) {
+ strncpy(buf3, "Method*", BSZ);
+ } else {
+ snprintf(buf3, BSZ, "ct%d", i - cUnit->numDalvikRegisters);
+ }
+
+ snprintf(buf2, BSZ, "V[%s] -> %s%d%s", buf3,
vRegMap.coreLocation == kLocPhysReg ?
"r" : "SP+", vRegMap.coreLocation == kLocPhysReg ?
vRegMap.coreReg : oatSRegOffset(cUnit, i), buf);
@@ -345,17 +356,6 @@
}
}
-void oatDumpFullPromotionMap(CompilationUnit *cUnit)
-{
- for (int i = 0; i < cUnit->numDalvikRegisters; i++) {
- PromotionMap vRegMap = cUnit->promotionMap[i];
- LOG(INFO) << i << " -> " << "CL:" << (int)vRegMap.coreLocation <<
- ", CR:" << (int)vRegMap.coreReg << ", FL:" <<
- (int)vRegMap.fpLocation << ", FR:" << (int)vRegMap.fpReg <<
- ", - " << (int)vRegMap.firstInPair;
- }
-}
-
/* Dump instructions and constant pool contents */
void oatCodegenDump(CompilationUnit* cUnit)
{