From f448016e70fa91269d3750384aab1ac98d7896fd Mon Sep 17 00:00:00 2001 From: David Srbecky Date: Wed, 16 Mar 2016 00:06:24 +0000 Subject: Do not JIT boot image during native-debugging (keep AOT code instead). The performance impact is currently significant and being able to debug framework is not our primary goal for native debugging. Change-Id: I3366c2a6317004f9dd16700b271a6c9b974f1c6e --- runtime/class_linker.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'runtime/class_linker.cc') diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index 3c69323b20..902ba03ea5 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -2722,13 +2722,18 @@ bool ClassLinker::ShouldUseInterpreterEntrypoint(ArtMethod* method, const void* return true; } - if (runtime->UseJit() && runtime->GetJit()->JitAtFirstUse()) { - // The force JIT uses the interpreter entry point to execute the JIT. - return true; + if (runtime->IsNativeDebuggable()) { + DCHECK(runtime->UseJit() && 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. + return !runtime->GetHeap()->IsInBootImageOatFile(quick_code); } if (Dbg::IsDebuggerActive()) { - // Boot image classes are AOT-compiled as non-debuggable. + // 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); } -- cgit v1.2.3-59-g8ed1b