Adjust code lookup logic in artQuickResolutionTrampoline.
Check whether the method needs to be run through the interpreter after
fetching the code we want to run.
Test: test.py
Bug: 156236098
Change-Id: I95c774b1955261a812a93c4c0e3915275c5014a8
diff --git a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
index b597518..8508086 100644
--- a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
@@ -1385,19 +1385,14 @@
success = linker->EnsureInitialized(soa.Self(), h_called_class, true, true);
}
if (success) {
- bool force_interpreter = self->IsForceInterpreter() && !called->IsNative();
- if (UNLIKELY(force_interpreter)) {
- // If we are single-stepping or the called method is deoptimized (by a
- // breakpoint, for example), then we have to execute the called method
- // with the interpreter.
+ code = called->GetEntryPointFromQuickCompiledCode();
+ if (linker->IsQuickResolutionStub(code)) {
+ DCHECK_EQ(invoke_type, kStatic);
+ // Go to JIT or oat and grab code.
+ code = linker->GetQuickOatCodeFor(called);
+ }
+ if (linker->ShouldUseInterpreterEntrypoint(called, code)) {
code = GetQuickToInterpreterBridge();
- } else {
- code = called->GetEntryPointFromQuickCompiledCode();
- if (linker->IsQuickResolutionStub(code)) {
- DCHECK_EQ(invoke_type, kStatic);
- // Go to JIT or oat and grab code.
- code = linker->GetQuickOatCodeFor(called);
- }
}
} else {
DCHECK(called_class->IsErroneous());