diff options
Diffstat (limited to 'runtime/class_linker.cc')
-rw-r--r-- | runtime/class_linker.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index 1edb694a1d..953cc676dc 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -2236,11 +2236,14 @@ bool ClassLinker::AddImageSpace(gc::space::ImageSpace* space, // If we are profiling the boot classpath, we disable the shared memory // optimization to make sure boot classpath methods all get properly // profiled. + // For debuggable runtimes we don't use AOT code, so don't use shared memory + // optimization so the methods can be JITed better. // // We need to disable the flag before doing ResetCounter below, as counters // of shared memory method always hold the "hot" value. if (!runtime->IsZygote() || - runtime->GetJITOptions()->GetProfileSaverOptions().GetProfileBootClassPath()) { + runtime->GetJITOptions()->GetProfileSaverOptions().GetProfileBootClassPath() || + runtime->IsJavaDebuggable()) { header.VisitPackedArtMethods([&](ArtMethod& method) REQUIRES_SHARED(Locks::mutator_lock_) { method.ClearMemorySharedMethod(); }, space->Begin(), image_pointer_size_); |