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
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 3c69323..902ba03 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -2722,13 +2722,18 @@
     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);
   }