Reland "Use InitializeMethodsCode when we need to reinitialize a method entrypoint."
This reverts commit b0f63c93e44bf53a34dda90c74b8725a932922da.
Reason for revert: Fix For proxy init.
Test: test.py
Change-Id: I6b4796115d73a093f86309cec1f03cafd981c2e9
diff --git a/runtime/jit/jit_code_cache.cc b/runtime/jit/jit_code_cache.cc
index 8b91f9e..34ddfc4 100644
--- a/runtime/jit/jit_code_cache.cc
+++ b/runtime/jit/jit_code_cache.cc
@@ -793,8 +793,7 @@
}
ClearMethodCounter(method, /* was_warm= */ false);
- Runtime::Current()->GetInstrumentation()->UpdateMethodsCode(
- method, GetQuickToInterpreterBridge());
+ Runtime::Current()->GetInstrumentation()->InitializeMethodsCode(method, /*aot_code=*/ nullptr);
VLOG(jit)
<< "JIT removed (osr=" << std::boolalpha << osr << std::noboolalpha << ") "
<< ArtMethod::PrettyMethod(method) << "@" << method
@@ -1318,7 +1317,8 @@
OatQuickMethodHeader::FromEntryPoint(entry_point);
if (CodeInfo::IsBaseline(method_header->GetOptimizedCodeInfoPtr())) {
info->GetMethod()->ResetCounter(warmup_threshold);
- info->GetMethod()->SetEntryPointFromQuickCompiledCode(GetQuickToInterpreterBridge());
+ Runtime::Current()->GetInstrumentation()->InitializeMethodsCode(
+ info->GetMethod(), /*aot_code=*/ nullptr);
}
}
}
@@ -1744,7 +1744,7 @@
if (meth->IsObsolete()) {
linker->SetEntryPointsForObsoleteMethod(meth);
} else {
- linker->SetEntryPointsToInterpreter(meth);
+ Runtime::Current()->GetInstrumentation()->InitializeMethodsCode(meth, /*aot_code=*/ nullptr);
}
}
saved_compiled_methods_map_.clear();
@@ -1761,8 +1761,7 @@
if (method_entrypoint == header->GetEntryPoint()) {
// The entrypoint is the one to invalidate, so we just update it to the interpreter entry point
// and clear the counter to get the method Jitted again.
- Runtime::Current()->GetInstrumentation()->UpdateMethodsCode(
- method, GetQuickToInterpreterBridge());
+ Runtime::Current()->GetInstrumentation()->InitializeMethodsCode(method, /*aot_code=*/ nullptr);
ClearMethodCounter(method, /*was_warm=*/ true);
} else {
MutexLock mu(Thread::Current(), *Locks::jit_lock_);