diff options
author | 2020-06-28 15:01:29 +0100 | |
---|---|---|
committer | 2020-06-29 08:39:40 +0000 | |
commit | 53b17f94405b42dc4ab4a128176af68cad39b1e9 (patch) | |
tree | f2add9752a6ab1bb59c55e1c1ab754ce969a2587 | |
parent | c69b3f84623458fb59fa63002f515bc062d7adad (diff) |
Fix brainos in UpdateHotness.
- Use '>' instead of '&' as we increment by more than 1.
- Set the counter to the maximum hotness, to actually get nterp
execution to ask for JIT compilation (otherwise UpdateHotness and
nterp execution keep on stepping on each other).
Test: 1935-get-set-current-frame-jit
Bug: 112676029
Change-Id: I2bba923e8c594543778520fbd5d28f2866afe619
-rw-r--r-- | runtime/interpreter/mterp/nterp.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/interpreter/mterp/nterp.cc b/runtime/interpreter/mterp/nterp.cc index 2e64a7bc34..fef944f4b8 100644 --- a/runtime/interpreter/mterp/nterp.cc +++ b/runtime/interpreter/mterp/nterp.cc @@ -79,11 +79,11 @@ inline void UpdateHotness(ArtMethod* method) REQUIRES_SHARED(Locks::mutator_lock // Convert to uint32_t to handle uint16_t overflow. uint32_t counter = method->GetCounter(); uint32_t new_counter = counter + kNterpHotnessLookup; - if ((new_counter & kNterpHotnessMask) == 0) { + if (new_counter > kNterpHotnessMask) { // Let the nterp code actually call the compilation: we want to make sure // there's at least a second execution of the method or a back-edge to avoid // compiling straightline initialization methods. - method->SetCounter(kNterpHotnessMask - 1); + method->SetCounter(kNterpHotnessMask); } else { method->SetCounter(new_counter); } |