Revert "Prevent overflow for AOT hotness counters"
This reverts commit 79e6eb8b79be6249358b7801bc511290dacf10d0.
Bug: 139883463
Reason for revert: 674-hotness-compiled fails on target.
Change-Id: I02fce74d70a4ae69dd5b4ae3924aa11728d9e16f
diff --git a/compiler/optimizing/code_generator_arm64.cc b/compiler/optimizing/code_generator_arm64.cc
index 269b4e9..a299ece 100644
--- a/compiler/optimizing/code_generator_arm64.cc
+++ b/compiler/optimizing/code_generator_arm64.cc
@@ -1068,10 +1068,8 @@
if (GetCompilerOptions().CountHotnessInCompiledCode()) {
UseScratchRegisterScope temps(masm);
Register temp = temps.AcquireX();
- __ Ldrsh(temp, MemOperand(kArtMethodRegister, ArtMethod::HotnessCountOffset().Int32Value()));
- __ Adds(temp, temp, 1);
- // Subtract carry if it overflowed.
- __ Sbc(temp, temp, xzr);
+ __ Ldrh(temp, MemOperand(kArtMethodRegister, ArtMethod::HotnessCountOffset().Int32Value()));
+ __ Add(temp, temp, 1);
__ Strh(temp, MemOperand(kArtMethodRegister, ArtMethod::HotnessCountOffset().Int32Value()));
}
@@ -3177,10 +3175,8 @@
Register temp1 = temps.AcquireX();
Register temp2 = temps.AcquireX();
__ Ldr(temp1, MemOperand(sp, 0));
- __ Ldrsh(temp2, MemOperand(temp1, ArtMethod::HotnessCountOffset().Int32Value()));
- __ Adds(temp2, temp2, 1);
- // Subtract carry if it overflowed.
- __ Sbc(temp2, temp2, xzr);
+ __ Ldrh(temp2, MemOperand(temp1, ArtMethod::HotnessCountOffset().Int32Value()));
+ __ Add(temp2, temp2, 1);
__ Strh(temp2, MemOperand(temp1, ArtMethod::HotnessCountOffset().Int32Value()));
}
GenerateSuspendCheck(info->GetSuspendCheck(), successor);