summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/interpreter/mterp/mterp.cc5
-rw-r--r--runtime/jit/jit_instrumentation.cc5
2 files changed, 7 insertions, 3 deletions
diff --git a/runtime/interpreter/mterp/mterp.cc b/runtime/interpreter/mterp/mterp.cc
index de9041befc..1da1181503 100644
--- a/runtime/interpreter/mterp/mterp.cc
+++ b/runtime/interpreter/mterp/mterp.cc
@@ -718,6 +718,11 @@ extern "C" bool MterpMaybeDoOnStackReplacement(Thread* self,
ArtMethod* method = shadow_frame->GetMethod();
JValue* result = shadow_frame->GetResultRegister();
uint32_t dex_pc = shadow_frame->GetDexPC();
+ jit::Jit* jit = Runtime::Current()->GetJit();
+ if (offset <= 0) {
+ // Keep updating hotness in case a compilation request was dropped. Eventually it will retry.
+ jit->GetInstrumentationCache()->AddSamples(self, method, 1);
+ }
// Assumes caller has already determined that an OSR check is appropriate.
return jit::Jit::MaybeDoOnStackReplacement(self, method, dex_pc, offset, result);
}
diff --git a/runtime/jit/jit_instrumentation.cc b/runtime/jit/jit_instrumentation.cc
index b18d6a218d..d2180c7ce2 100644
--- a/runtime/jit/jit_instrumentation.cc
+++ b/runtime/jit/jit_instrumentation.cc
@@ -183,9 +183,8 @@ void JitInstrumentationCache::AddSamples(Thread* self, ArtMethod* method, uint16
thread_pool_->AddTask(self, new JitCompileTask(method, JitCompileTask::kCompileOsr));
}
}
- // Update hotness counter, but avoid wrap around.
- method->SetCounter(
- std::min(new_count, static_cast<int32_t>(std::numeric_limits<uint16_t>::max())));
+ // Update hotness counter
+ method->SetCounter(new_count);
}
JitInstrumentationListener::JitInstrumentationListener(JitInstrumentationCache* cache)