Implement direct apk -> boot calling
Also sharpen super calls.
Change-Id: Ie4d3ab2cbf2961a06ec86762a53132f49a4ed922
diff --git a/src/compiler/codegen/MethodCodegenDriver.cc b/src/compiler/codegen/MethodCodegenDriver.cc
index be8f1f9..64f55c6 100644
--- a/src/compiler/codegen/MethodCodegenDriver.cc
+++ b/src/compiler/codegen/MethodCodegenDriver.cc
@@ -70,10 +70,13 @@
uint32_t dexMethodIdx = dInsn->vB;
int vtableIdx;
+ uintptr_t directCode;
+ uintptr_t directMethod;
bool skipThis;
bool fastPath =
cUnit->compiler->ComputeInvokeInfo(dexMethodIdx, &mUnit, type,
- vtableIdx)
+ vtableIdx, directCode,
+ directMethod)
&& !SLOW_INVOKE_PATH;
if (type == kInterface) {
nextCallInsn = fastPath ? nextInterfaceCallInsn
@@ -89,8 +92,9 @@
nextCallInsn = fastPath ? nextSDCallInsn : nextStaticCallInsnSP;
skipThis = false;
} else if (type == kSuper) {
- nextCallInsn = fastPath ? nextSuperCallInsn : nextSuperCallInsnSP;
- skipThis = fastPath;
+ DCHECK(!fastPath); // Fast path is a direct call.
+ nextCallInsn = nextSuperCallInsnSP;
+ skipThis = false;
} else {
DCHECK_EQ(type, kVirtual);
nextCallInsn = fastPath ? nextVCallInsn : nextVCallInsnSP;
@@ -99,16 +103,16 @@
if (!isRange) {
callState = genDalvikArgsNoRange(cUnit, mir, dInsn, callState, pNullCk,
nextCallInsn, dexMethodIdx,
- vtableIdx, skipThis);
+ vtableIdx, directCode, directMethod, skipThis);
} else {
callState = genDalvikArgsRange(cUnit, mir, dInsn, callState, pNullCk,
nextCallInsn, dexMethodIdx, vtableIdx,
- skipThis);
+ directCode, directMethod, skipThis);
}
// Finish up any of the call sequence not interleaved in arg loading
while (callState >= 0) {
callState = nextCallInsn(cUnit, mir, callState, dexMethodIdx,
- vtableIdx);
+ vtableIdx, directCode, directMethod);
}
if (DISPLAY_MISSING_TARGETS) {
genShowTarget(cUnit);