Make --debuggable rely on JIT code.
Removes -Xfully-deoptable in the process, which was added as a
temporary workaround until this CL.
Partial revert of https://android-review.googlesource.com/#/c/302232/
Makes things consistent with existing infrastructure:
- Parse the --debuggable from the compiler options, just like
--compiler-filter.
- Add DEBUG_JAVA_DEBUGGABLE, passed by the zygote, for debuggable apps.
- Java debuggable now solely relies on JIT for simplicity.
- Debugging under userdebug for non-java-debuggable apps is still
best effort.
Test: test-art-host, jdwp
bug: 28769520
Change-Id: Id0593aacd85b9780da97f20914a50943957c858f
diff --git a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
index eb76fb6..bde9009 100644
--- a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
@@ -781,15 +781,19 @@
// If caller_pc is the instrumentation exit stub, the stub will check to see if deoptimization
// should be done and it knows the real return pc.
if (UNLIKELY(caller_pc != reinterpret_cast<uintptr_t>(GetQuickInstrumentationExitPc()) &&
- Dbg::IsForcedInterpreterNeededForUpcall(self, caller) &&
- Runtime::Current()->IsDeoptimizeable(caller_pc))) {
- // Push the context of the deoptimization stack so we can restore the return value and the
- // exception before executing the deoptimized frames.
- self->PushDeoptimizationContext(
- result, shorty[0] == 'L', /* from_code */ false, self->GetException());
+ Dbg::IsForcedInterpreterNeededForUpcall(self, caller))) {
+ if (!Runtime::Current()->IsAsyncDeoptimizeable(caller_pc)) {
+ LOG(WARNING) << "Got a deoptimization request on un-deoptimizable method "
+ << caller->PrettyMethod();
+ } else {
+ // Push the context of the deoptimization stack so we can restore the return value and the
+ // exception before executing the deoptimized frames.
+ self->PushDeoptimizationContext(
+ result, shorty[0] == 'L', /* from_code */ false, self->GetException());
- // Set special exception to cause deoptimization.
- self->SetException(Thread::GetDeoptimizationException());
+ // Set special exception to cause deoptimization.
+ self->SetException(Thread::GetDeoptimizationException());
+ }
}
// No need to restore the args since the method has already been run by the interpreter.