Don't use nterp when instrumentation is active
Using nterp requires the use of instrumentation stubs that call method
entry / exit hooks required for supporting features related to
instrumentation. We want to remove instrumentation stubs since that
requires updating stack addresses and maintaining additional information
in a side table. So disable nterp when instrumentation is active.
JITing is still supported, so debugger performance isn't expected to
impact too much.
Bug: 206029744
Test: art/test.py
Change-Id: I25c667188d2d04f6a0e0bb9ceaedb9df073cae9e
diff --git a/runtime/interpreter/mterp/nterp.cc b/runtime/interpreter/mterp/nterp.cc
index a652d62..6d14f6d 100644
--- a/runtime/interpreter/mterp/nterp.cc
+++ b/runtime/interpreter/mterp/nterp.cc
@@ -44,9 +44,11 @@
// parts of the runtime (like instrumentation) make assumption on an
// interpreter-only runtime to always be in a switch-like interpreter.
return IsNterpSupported() &&
+ !runtime->IsJavaDebuggable() &&
+ !instr->AreExitStubsInstalled() &&
!instr->InterpretOnly() &&
!runtime->IsAotCompiler() &&
- !runtime->GetInstrumentation()->NeedsSlowInterpreterForListeners() &&
+ !instr->NeedsSlowInterpreterForListeners() &&
// An async exception has been thrown. We need to go to the switch interpreter. nterp doesn't
// know how to deal with these so we could end up never dealing with it if we are in an
// infinite loop.