Some more interpreter cleanup.
- Pass method helper and code item to entry point so they don't
have to be regenerated.
- Removed interpreter only check from invoke, changing entry
points instead.
Change-Id: Ib0ea83dcffcdb295d3a48d92ad8a93ac59f9932e
diff --git a/src/class_linker.cc b/src/class_linker.cc
index 52ce964..46c2ade 100644
--- a/src/class_linker.cc
+++ b/src/class_linker.cc
@@ -74,7 +74,8 @@
namespace art {
-void artInterpreterToQuickEntry(Thread* self, ShadowFrame* shadow_frame, JValue* result);
+void artInterpreterToQuickEntry(Thread* self, MethodHelper& mh, const DexFile::CodeItem* code_item,
+ ShadowFrame* shadow_frame, JValue* result);
static void ThrowNoClassDefFoundError(const char* fmt, ...)
__attribute__((__format__(__printf__, 1, 2)))
@@ -1041,7 +1042,9 @@
if (obj->IsMethod()) {
mirror::AbstractMethod* method = obj->AsMethod();
// Install entry point from interpreter.
- if (method->GetEntryPointFromCompiledCode() == NULL && !method->IsNative() && !method->IsProxyMethod()) {
+ if (!method->IsNative() && !method->IsProxyMethod() &&
+ (method->GetEntryPointFromCompiledCode() == NULL ||
+ Runtime::Current()->GetInstrumentation()->InterpretOnly())) {
method->SetEntryPointFromInterpreter(interpreter::EnterInterpreterFromInterpreter);
} else {
method->SetEntryPointFromInterpreter(artInterpreterToQuickEntry);
@@ -1608,14 +1611,15 @@
oat_method.LinkMethod(method.get());
// Install entry point from interpreter.
- if (method->GetEntryPointFromCompiledCode() == NULL && !method->IsNative() &&
- !method->IsProxyMethod()) {
+ Runtime* runtime = Runtime::Current();
+ if (!method->IsNative() && !method->IsProxyMethod() &&
+ (method->GetEntryPointFromCompiledCode() == NULL ||
+ runtime->GetInstrumentation()->InterpretOnly())) {
method->SetEntryPointFromInterpreter(interpreter::EnterInterpreterFromInterpreter);
} else {
method->SetEntryPointFromInterpreter(artInterpreterToQuickEntry);
}
- Runtime* runtime = Runtime::Current();
if (method->IsAbstract()) {
method->SetEntryPointFromCompiledCode(GetAbstractMethodErrorStub());
return;
@@ -1631,7 +1635,9 @@
method->UnregisterNative(Thread::Current());
}
- if (method->GetEntryPointFromCompiledCode() == NULL) {
+ if (method->GetEntryPointFromCompiledCode() == NULL ||
+ (runtime->GetInstrumentation()->InterpretOnly() && !method->IsNative() &&
+ !method->IsProxyMethod())) {
// No code? You must mean to go into the interpreter.
method->SetEntryPointFromCompiledCode(GetInterpreterEntryPoint());
}