Remove obsolete saved_entry_point field in ProfilingInfo.
It was used for doing GC of jit code, but we are now relying on baseline
for giving that information.
Bug: 112676029
Test: test.py
Change-Id: Icb7c7b6adfe77a30500d53505b391b9d3aad19e6
diff --git a/runtime/instrumentation.cc b/runtime/instrumentation.cc
index 1838984..42baf2a 100644
--- a/runtime/instrumentation.cc
+++ b/runtime/instrumentation.cc
@@ -1160,16 +1160,6 @@
// If we don't need a debug version we should see what the oat file/class linker has to say.
result = class_linker->GetQuickOatCodeFor(method);
}
- // If both those fail try the jit.
- if (result == GetQuickToInterpreterBridge()) {
- jit::Jit* jit = Runtime::Current()->GetJit();
- if (jit != nullptr) {
- const void* res = jit->GetCodeCache()->FindCompiledCodeForInstrumentation(method);
- if (res != nullptr) {
- result = res;
- }
- }
- }
return result;
}
diff --git a/runtime/jit/jit_code_cache.cc b/runtime/jit/jit_code_cache.cc
index a1a96d2..4b9538d 100644
--- a/runtime/jit/jit_code_cache.cc
+++ b/runtime/jit/jit_code_cache.cc
@@ -291,8 +291,6 @@
ScopedAssertNoThreadSuspension sants(__FUNCTION__);
if (ContainsPc(method->GetEntryPointFromQuickCompiledCode())) {
return true;
- } else if (method->GetEntryPointFromQuickCompiledCode() == GetQuickInstrumentationEntryPoint()) {
- return FindCompiledCodeForInstrumentation(method) != nullptr;
}
return false;
}
@@ -332,22 +330,6 @@
return nullptr;
}
-const void* JitCodeCache::FindCompiledCodeForInstrumentation(ArtMethod* method) {
- // If jit-gc is still on we use the SavedEntryPoint field for doing that and so cannot use it to
- // find the instrumentation entrypoint.
- if (LIKELY(GetGarbageCollectCode())) {
- return nullptr;
- }
- ProfilingInfo* info = method->GetProfilingInfo(kRuntimePointerSize);
- if (info == nullptr) {
- return nullptr;
- }
- // When GC is disabled for trampoline tracing we will use SavedEntrypoint to hold the actual
- // jit-compiled version of the method. If jit-gc is disabled for other reasons this will just be
- // nullptr.
- return info->GetSavedEntryPoint();
-}
-
const void* JitCodeCache::GetSavedEntryPointOfPreCompiledMethod(ArtMethod* method) {
if (method->IsPreCompiled()) {
const void* code_ptr = nullptr;
@@ -904,8 +886,6 @@
// checks should always pass.
DCHECK(!info->IsInUseByCompiler());
new_method->SetProfilingInfo(info);
- // Get rid of the old saved entrypoint if it is there.
- info->SetSavedEntryPoint(nullptr);
info->method_ = new_method;
}
// Update method_code_map_ to point to the new method.
@@ -1265,19 +1245,8 @@
void JitCodeCache::SetGarbageCollectCode(bool value) {
Thread* self = Thread::Current();
MutexLock mu(self, *Locks::jit_lock_);
- if (garbage_collect_code_ != value) {
- if (garbage_collect_code_) {
- // When dynamically disabling the garbage collection, we neee
- // to make sure that a potential current collection is finished, and also
- // clear the saved entry point in profiling infos to avoid dangling pointers.
- WaitForPotentialCollectionToComplete(self);
- for (ProfilingInfo* info : profiling_infos_) {
- info->SetSavedEntryPoint(nullptr);
- }
- }
- // Update the flag while holding the lock to ensure no thread will try to GC.
- garbage_collect_code_ = value;
- }
+ // Update the flag while holding the lock to ensure no thread will try to GC.
+ garbage_collect_code_ = value;
}
void JitCodeCache::RemoveMethodBeingCompiled(ArtMethod* method, CompilationKind kind) {
@@ -1804,7 +1773,6 @@
for (ProfilingInfo* pi : profiling_infos_) {
// NB Due to OSR we might run this on some methods multiple times but this should be fine.
ArtMethod* meth = pi->GetMethod();
- pi->SetSavedEntryPoint(nullptr);
// We had a ProfilingInfo so we must be warm.
ClearMethodCounter(meth, /*was_warm=*/true);
ClassLinker* linker = Runtime::Current()->GetClassLinker();
@@ -1824,13 +1792,6 @@
DCHECK(!method->IsNative());
ProfilingInfo* profiling_info = method->GetProfilingInfo(kRuntimePointerSize);
const void* method_entrypoint = method->GetEntryPointFromQuickCompiledCode();
- if ((profiling_info != nullptr) &&
- (profiling_info->GetSavedEntryPoint() == header->GetEntryPoint())) {
- // When instrumentation is set, the actual entrypoint is the one in the profiling info.
- method_entrypoint = profiling_info->GetSavedEntryPoint();
- // Prevent future uses of the compiled code.
- profiling_info->SetSavedEntryPoint(nullptr);
- }
// Clear the method counter if we are running jitted code since we might want to jit this again in
// the future.
diff --git a/runtime/jit/jit_code_cache.h b/runtime/jit/jit_code_cache.h
index 12a21a3..e8ab117 100644
--- a/runtime/jit/jit_code_cache.h
+++ b/runtime/jit/jit_code_cache.h
@@ -375,12 +375,6 @@
return &zygote_map_;
}
- // If Jit-gc has been disabled (and instrumentation has been enabled) this will return the
- // jit-compiled entrypoint for this method. Otherwise it will return null.
- const void* FindCompiledCodeForInstrumentation(ArtMethod* method)
- REQUIRES(!Locks::jit_lock_)
- REQUIRES_SHARED(Locks::mutator_lock_);
-
// Fetch the code of a method that was JITted, but the JIT could not
// update its entrypoint due to the resolution trampoline.
const void* GetSavedEntryPointOfPreCompiledMethod(ArtMethod* method)
diff --git a/runtime/jit/profiling_info.cc b/runtime/jit/profiling_info.cc
index d039bb3..a61a30d 100644
--- a/runtime/jit/profiling_info.cc
+++ b/runtime/jit/profiling_info.cc
@@ -28,7 +28,6 @@
ProfilingInfo::ProfilingInfo(ArtMethod* method, const std::vector<uint32_t>& entries)
: baseline_hotness_count_(0),
method_(method),
- saved_entry_point_(nullptr),
number_of_inline_caches_(entries.size()),
current_inline_uses_(0) {
memset(&cache_, 0, number_of_inline_caches_ * sizeof(InlineCache));
diff --git a/runtime/jit/profiling_info.h b/runtime/jit/profiling_info.h
index cb9e423..cbe2445 100644
--- a/runtime/jit/profiling_info.h
+++ b/runtime/jit/profiling_info.h
@@ -83,14 +83,6 @@
InlineCache* GetInlineCache(uint32_t dex_pc)
REQUIRES_SHARED(Locks::mutator_lock_);
- void SetSavedEntryPoint(const void* entry_point) {
- saved_entry_point_ = entry_point;
- }
-
- const void* GetSavedEntryPoint() const {
- return saved_entry_point_;
- }
-
// Increments the number of times this method is currently being inlined.
// Returns whether it was successful, that is it could increment without
// overflowing.
@@ -136,10 +128,6 @@
// See JitCodeCache::MoveObsoleteMethod.
ArtMethod* method_;
- // Entry point of the corresponding ArtMethod, while the JIT code cache
- // is poking for the liveness of compiled code.
- const void* saved_entry_point_;
-
// Number of instructions we are profiling in the ArtMethod.
const uint32_t number_of_inline_caches_;