summaryrefslogtreecommitdiff
path: root/src/compiler/codegen/MethodCodegenDriver.cc
diff options
context:
space:
mode:
author Ian Rogers <irogers@google.com> 2012-04-04 10:31:28 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2012-04-04 10:31:28 -0700
commit1747753150ccb07eb92375de3f7a62a3bff14a81 (patch)
treead937dade2963561ccf6536b1ec986f7d91d9981 /src/compiler/codegen/MethodCodegenDriver.cc
parent540a5b768bf5f76bd71ebf66612fb2298899480f (diff)
parent7caad77632ae121c9f64c488e3f8f710e2c4813d (diff)
Merge "Implement various missing parts of the X86 compiler" into ics-mr1-plus-art
Diffstat (limited to 'src/compiler/codegen/MethodCodegenDriver.cc')
-rw-r--r--src/compiler/codegen/MethodCodegenDriver.cc26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/compiler/codegen/MethodCodegenDriver.cc b/src/compiler/codegen/MethodCodegenDriver.cc
index 5ffe3e44c2..b28df0183e 100644
--- a/src/compiler/codegen/MethodCodegenDriver.cc
+++ b/src/compiler/codegen/MethodCodegenDriver.cc
@@ -128,11 +128,31 @@ void genInvoke(CompilationUnit* cUnit, BasicBlock* bb, MIR* mir,
#if !defined(TARGET_X86)
opReg(cUnit, kOpBlx, rINVOKE_TGT);
#else
- if (fastPath) {
+ if (fastPath && type != kInterface) {
opMem(cUnit, kOpBlx, rARG0, Method::GetCodeOffset().Int32Value());
} else {
- UNIMPLEMENTED(FATAL) << "compute trampoline";
- opThreadMem(cUnit, kOpBlx, 0);
+ int trampoline = 0;
+ switch (type) {
+ case kInterface:
+ trampoline = fastPath ? ENTRYPOINT_OFFSET(pInvokeInterfaceTrampoline)
+ : ENTRYPOINT_OFFSET(pInvokeInterfaceTrampolineWithAccessCheck);
+ break;
+ case kDirect:
+ trampoline = ENTRYPOINT_OFFSET(pInvokeDirectTrampolineWithAccessCheck);
+ break;
+ case kStatic:
+ trampoline = ENTRYPOINT_OFFSET(pInvokeStaticTrampolineWithAccessCheck);
+ break;
+ case kSuper:
+ trampoline = ENTRYPOINT_OFFSET(pInvokeSuperTrampolineWithAccessCheck);
+ break;
+ case kVirtual:
+ trampoline = ENTRYPOINT_OFFSET(pInvokeVirtualTrampolineWithAccessCheck);
+ break;
+ default:
+ LOG(FATAL) << "Unexpected invoke type";
+ }
+ opThreadMem(cUnit, kOpBlx, trampoline);
}
#endif