diff options
-rw-r--r-- | runtime/class_linker.cc | 5 | ||||
-rw-r--r-- | runtime/runtime.cc | 13 |
2 files changed, 5 insertions, 13 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index fb1b4651ce..a476ed67cc 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -2236,14 +2236,11 @@ 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->IsJavaDebuggable()) { + runtime->GetJITOptions()->GetProfileSaverOptions().GetProfileBootClassPath()) { header.VisitPackedArtMethods([&](ArtMethod& method) REQUIRES_SHARED(Locks::mutator_lock_) { method.ClearMemorySharedMethod(); }, space->Begin(), image_pointer_size_); diff --git a/runtime/runtime.cc b/runtime/runtime.cc index 772f47ae2a..5dbe73fb15 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -3257,12 +3257,10 @@ RuntimeCallbacks* Runtime::GetRuntimeCallbacks() { return callbacks_.get(); } -// Used to update boot image to not use AOT code. This is used when transitioning the runtime to -// java debuggable. This visitor re-initializes the entry points without using AOT code. This also -// disables shared hotness counters so the necessary methods can be JITed more efficiently. -class DeoptimizeBootImageClassVisitor : public ClassVisitor { +// Used to patch boot image method entry point to interpreter bridge. +class UpdateEntryPointsClassVisitor : public ClassVisitor { public: - explicit DeoptimizeBootImageClassVisitor(instrumentation::Instrumentation* instrumentation) + explicit UpdateEntryPointsClassVisitor(instrumentation::Instrumentation* instrumentation) : instrumentation_(instrumentation) {} bool operator()(ObjPtr<mirror::Class> klass) override REQUIRES(Locks::mutator_lock_) { @@ -3296,9 +3294,6 @@ class DeoptimizeBootImageClassVisitor : public ClassVisitor { m.ClearPreCompiled(); instrumentation_->InitializeMethodsCode(&m, /*aot_code=*/ nullptr); } - - // Clear MemorySharedAccessFlags so the boot class methods can be JITed better. - m.ClearMemorySharedMethod(); } return true; } @@ -3319,7 +3314,7 @@ void Runtime::DeoptimizeBootImage() { // If we've already started and we are setting this runtime to debuggable, // we patch entry points of methods in boot image to interpreter bridge, as // boot image code may be AOT compiled as not debuggable. - DeoptimizeBootImageClassVisitor visitor(GetInstrumentation()); + UpdateEntryPointsClassVisitor visitor(GetInstrumentation()); GetClassLinker()->VisitClasses(&visitor); jit::Jit* jit = GetJit(); if (jit != nullptr) { |