From 433b79a9130df5f2375b9d3d7518c1f3fb84a467 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Mon, 30 Jan 2017 20:54:45 +0000 Subject: Revert "Revert "Make --debuggable rely on JIT code."" Fixed by https://android-review.googlesource.com/#/c/330165/ This reverts commit 81356645157af44152c7b7db383596b5cf3479b5. Change-Id: Ifb74e1cc90ab6dea621f7f54a00b540d6ccd0cf6 --- runtime/class_linker.cc | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'runtime/class_linker.cc') diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index 02b26c6568..edd6e3b522 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -2862,9 +2862,12 @@ bool ClassLinker::ShouldUseInterpreterEntrypoint(ArtMethod* method, const void* return true; } - if (runtime->IsFullyDeoptable()) { - // We need to be able to deoptimize at any time so we should always just ignore precompiled - // code and go to the interpreter assuming we don't already have jitted code. + if (runtime->IsJavaDebuggable()) { + // For simplicity, we ignore precompiled code and go to the interpreter + // assuming we don't already have jitted code. + // We could look at the oat file where `quick_code` is being defined, + // and check whether it's been compiled debuggable, but we decided to + // only rely on the JIT for debuggable apps. jit::Jit* jit = Runtime::Current()->GetJit(); return (jit == nullptr) || !jit->GetCodeCache()->ContainsPc(quick_code); } @@ -2872,18 +2875,13 @@ bool ClassLinker::ShouldUseInterpreterEntrypoint(ArtMethod* method, const void* if (runtime->IsNativeDebuggable()) { DCHECK(runtime->UseJitCompilation() && runtime->GetJit()->JitAtFirstUse()); // If we are doing native debugging, ignore application's AOT code, - // since we want to JIT it with extra stackmaps for native debugging. - // On the other hand, keep all AOT code from the boot image, since the - // blocking JIT would results in non-negligible performance impact. + // since we want to JIT it (at first use) with extra stackmaps for native + // debugging. We keep however all AOT code from the boot image, + // since the JIT-at-first-use is blocking and would result in non-negligible + // startup performance impact. return !runtime->GetHeap()->IsInBootImageOatFile(quick_code); } - if (Dbg::IsDebuggerActive()) { - // Boot image classes may be AOT-compiled as non-debuggable. - // This is not suitable for the Java debugger, so ignore the AOT code. - return runtime->GetHeap()->IsInBootImageOatFile(quick_code); - } - return false; } -- cgit v1.2.3-59-g8ed1b