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/codegen/GenInvoke.cc b/src/compiler/codegen/GenInvoke.cc
index bcc9067..7c2cf1c 100644
--- a/src/compiler/codegen/GenInvoke.cc
+++ b/src/compiler/codegen/GenInvoke.cc
@@ -33,16 +33,18 @@
* If there are any ins passed in registers that have not been promoted
* to a callee-save register, flush them to the frame. Perform intial
* assignment of promoted arguments.
+ *
+ * argLocs is an array of location records describing the incoming arguments
+ * with one location record per word of argument.
*/
-void flushIns(CompilationUnit* cUnit)
+void flushIns(CompilationUnit* cUnit, RegLocation* argLocs, RegLocation rlMethod)
{
/*
* 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];
+ RegLocation rlSrc = rlMethod;
rlSrc.location = kLocPhysReg;
rlSrc.lowReg = rARG0;
rlSrc.home = false;
@@ -75,7 +77,7 @@
if (i < numArgRegs) {
// If arriving in register
bool needFlush = true;
- RegLocation* tLoc = &cUnit->regLocation[startVReg + i];
+ RegLocation* tLoc = &argLocs[i];
if ((vMap->coreLocation == kLocPhysReg) && !tLoc->fp) {
opRegCopy(cUnit, vMap->coreReg, argRegs[i]);
needFlush = false;