Reland "Change hotness counting."
This reverts commit ce131feb7c60ffdf28c315c5d67f9cac33a077ce.
Bug: 203810169
Test: test.py
Test: health/microbench/startup/hscapps/compile-speed-profile/open-clock
Reason for revert: Kept logic from before on what methods to save in the
profile.
Change-Id: Id67cd47a9fe31b4c6b154db20f632015238016d2
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 7bdf70f..6dbb3ff 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -1956,6 +1956,9 @@
const dex::CodeItem* code_item = method.GetDexFile()->GetCodeItem(
reinterpret_cast32<uint32_t>(method.GetDataPtrSize(image_pointer_size_)));
method.SetCodeItem(code_item);
+ // The hotness counter may have changed since we compiled the image, so
+ // reset it with the runtime value.
+ method.ResetCounter();
}
// Set image methods' entry point that point to the interpreter bridge to the
// nterp entry point.