summaryrefslogtreecommitdiff
path: root/runtime/jit/jit_code_cache.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2021-11-15 14:02:07 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2021-11-24 14:04:12 +0000
commit58f916cd6ce9eaeba7b4dbb96c3c77d636f64be5 (patch)
tree7186d7b3da40f110f487abcb9574a2f848336b36 /runtime/jit/jit_code_cache.cc
parent24d589eae75239486b512a8e624aee83bba0c315 (diff)
Replace the nterp threshold with the warmup threshold.
Replace a hardcoded value with one that can be changed at the command line. Test: test.py Change-Id: I638da5b5cc2e56aa0857d2bf0862a2f8c2020949
Diffstat (limited to 'runtime/jit/jit_code_cache.cc')
-rw-r--r--runtime/jit/jit_code_cache.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/jit/jit_code_cache.cc b/runtime/jit/jit_code_cache.cc
index e05ca111b2..3fcb10abad 100644
--- a/runtime/jit/jit_code_cache.cc
+++ b/runtime/jit/jit_code_cache.cc
@@ -615,7 +615,7 @@ static void ClearMethodCounter(ArtMethod* method, bool was_warm)
if (was_warm) {
method->SetPreviouslyWarm();
}
- method->ResetCounter();
+ method->ResetCounter(Runtime::Current()->GetJITOptions()->GetWarmupThreshold());
// We add one sample so that the profile knows that the method was executed at least once.
// This is required for layout purposes.
method->UpdateCounter(/* new_samples= */ 1);
@@ -1289,6 +1289,7 @@ void JitCodeCache::DoCollection(Thread* self, bool collect_profiling_info) {
// hotness count is zero.
// Note that these methods may be in thread stack or concurrently revived
// between. That's OK, as the thread executing it will mark it.
+ uint16_t warmup_threshold = Runtime::Current()->GetJITOptions()->GetWarmupThreshold();
for (auto it : profiling_infos_) {
ProfilingInfo* info = it.second;
if (info->GetBaselineHotnessCount() == 0) {
@@ -1297,7 +1298,7 @@ void JitCodeCache::DoCollection(Thread* self, bool collect_profiling_info) {
OatQuickMethodHeader* method_header =
OatQuickMethodHeader::FromEntryPoint(entry_point);
if (CodeInfo::IsBaseline(method_header->GetOptimizedCodeInfoPtr())) {
- info->GetMethod()->ResetCounter();
+ info->GetMethod()->ResetCounter(warmup_threshold);
info->GetMethod()->SetEntryPointFromQuickCompiledCode(GetQuickToInterpreterBridge());
}
}