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/compiler/optimizing/code_generator_arm64.cc b/compiler/optimizing/code_generator_arm64.cc
index d455614..a323405 100644
--- a/compiler/optimizing/code_generator_arm64.cc
+++ b/compiler/optimizing/code_generator_arm64.cc
@@ -1189,10 +1189,12 @@
__ Ldr(method, MemOperand(sp, 0));
}
__ Ldrh(counter, MemOperand(method, ArtMethod::HotnessCountOffset().Int32Value()));
- __ Add(counter, counter, 1);
- // Subtract one if the counter would overflow.
- __ Sub(counter, counter, Operand(counter, LSR, 16));
+ vixl::aarch64::Label done;
+ DCHECK_EQ(0u, interpreter::kNterpHotnessValue);
+ __ Cbz(counter, &done);
+ __ Add(counter, counter, -1);
__ Strh(counter, MemOperand(method, ArtMethod::HotnessCountOffset().Int32Value()));
+ __ Bind(&done);
}
if (GetGraph()->IsCompilingBaseline() && !Runtime::Current()->IsAotCompiler()) {