diff options
author | 2023-08-23 14:49:26 +0000 | |
---|---|---|
committer | 2023-08-25 16:32:47 +0000 | |
commit | 8f13c9d50fdc8bc03d0091eefd19dda7d2234fcc (patch) | |
tree | 995a423701372ebf70e3176222a0c868f5e97056 /runtime/class_linker.cc | |
parent | 2ccac33c87791e5a4117ab935c74f96f1369a9cc (diff) |
Don't use shared hotness counters for debuggable runtimes
Shared hotness counters is an optimization to avoid dirtying pages
shared with the zygote. The general idea is that most important methods
already have AOT code so it is okay to use shared counters to monitor
hotness of methods. In debuggable runtimes we don't use AOT code and
using shared hotness counters makes JITing of these methods. So don't
use shared hotness counters for debuggable runtime.
Bug: 296298460
Test: art/test.py
Change-Id: I1ce826dee6d03606c871093d6b3e69051c9a8760
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 a476ed67cc..fb1b4651ce 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_); |