Milestone: close Quick side channel communication
This CL elminates side-channel communication between the Quick
Compiler's Dex->MIR->LLVM-IR and LLVM-IR->LIR lowering stages by clearing
key data structures between the two stages.
The purpose if to flush out any hidden information transfer, and thus
ensure that the GreenlandIR representation of the program is sufficient.
Note that as of this change, we've lost all register promotion info
so the Quick compiler will generate non-promoted code. A near-future
CL will restore that info from the MethodInfo intrinsic.
Change-Id: I797845f1fc029bc03aac3ec20f8cd81f917817ca
diff --git a/src/compiler/Ralloc.cc b/src/compiler/Ralloc.cc
index 29766e0..0062f53 100644
--- a/src/compiler/Ralloc.cc
+++ b/src/compiler/Ralloc.cc
@@ -339,6 +339,17 @@
INVALID_REG, INVALID_REG, INVALID_SREG,
INVALID_SREG};
+int oatComputeFrameSize(CompilationUnit* cUnit) {
+ /* Figure out the frame size */
+ static const uint32_t kAlignMask = kStackAlignment - 1;
+ uint32_t size = (cUnit->numCoreSpills + cUnit->numFPSpills +
+ 1 /* filler word */ + cUnit->numRegs + cUnit->numOuts +
+ cUnit->numCompilerTemps + 1 /* curMethod* */)
+ * sizeof(uint32_t);
+ /* Align and set */
+ return (size + kAlignMask) & ~(kAlignMask);
+}
+
/*
* Simple register allocation. Some Dalvik virtual registers may
* be promoted to physical registers. Most of the work for temp
@@ -459,19 +470,16 @@
oatDoPromotion(cUnit);
+ /* Get easily-accessable post-promotion copy of RegLocation for Method* */
+ cUnit->methodLoc = cUnit->regLocation[cUnit->methodSReg];
+
if (cUnit->printMe && !(cUnit->disableOpt & (1 << kPromoteRegs))) {
LOG(INFO) << "After Promotion";
oatDumpRegLocTable(cUnit->regLocation, cUnit->numSSARegs);
}
- /* Figure out the frame size */
- static const uint32_t kAlignMask = kStackAlignment - 1;
- uint32_t size = (cUnit->numCoreSpills + cUnit->numFPSpills +
- 1 /* filler word */ + cUnit->numRegs + cUnit->numOuts +
- cUnit->numCompilerTemps + 1 /* curMethod* */)
- * sizeof(uint32_t);
- /* Align and set */
- cUnit->frameSize = (size + kAlignMask) & ~(kAlignMask);
+ /* Set the frame size */
+ cUnit->frameSize = oatComputeFrameSize(cUnit);
}
} // namespace art