Don't reset to a level above warmup threshold.
Otherwise, we could be in a situation where a profiling info
never gets allocated.
Test: 655-jit-clinit
Change-Id: I7eebab66e841784a8ce5cd32765df9fc7376cea8
diff --git a/runtime/jit/jit_code_cache.cc b/runtime/jit/jit_code_cache.cc
index 0cafac7..4cd2125 100644
--- a/runtime/jit/jit_code_cache.cc
+++ b/runtime/jit/jit_code_cache.cc
@@ -535,7 +535,10 @@
}
// We reset the counter to 1 so that the profile knows that the method was executed at least once.
// This is required for layout purposes.
- method->SetCounter(1);
+ // We also need to make sure we'll pass the warmup threshold again, so we set to 0 if
+ // the warmup threshold is 1.
+ uint16_t jit_warmup_threshold = Runtime::Current()->GetJITOptions()->GetWarmupThreshold();
+ method->SetCounter(std::min(jit_warmup_threshold - 1, 1));
}
uint8_t* JitCodeCache::CommitCodeInternal(Thread* self,
diff --git a/test/knownfailures.json b/test/knownfailures.json
index dee3b8d..8ab741a 100644
--- a/test/knownfailures.json
+++ b/test/knownfailures.json
@@ -708,11 +708,6 @@
"bug": "b/62350406"
},
{
- "tests": "655-jit-clinit",
- "description": [ "Currently broken in debug mode"],
- "variant": "debug"
- },
- {
"tests": ["137-cfi", "629-vdex-speed"],
"description": [ "Tests require speed compilation which is no longer the default for",
"no-prebuild configs."],