summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2024-02-05 14:34:46 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2024-02-06 11:31:06 +0000
commit5592ceb65d8b33c1ebcd5e0b3f317a0c9f60f188 (patch)
tree37ca223ad721c5f8ad6e6cd9233fa72cff8ba83f
parentc5ee51b87354b5f741eb956528ef9367917e9030 (diff)
For JIT at first use, compile the method directly.
There is no risk of racing with the JIT thread, which shouldn't be operating. Test: test.py Bug: 218263452 Change-Id: Iec63c723681865792fa5a95e966b43f33d5b2ccb
-rw-r--r--test/common/runtime_state.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/common/runtime_state.cc b/test/common/runtime_state.cc
index 9ed573f0f7..a385f4c8db 100644
--- a/test/common/runtime_state.cc
+++ b/test/common/runtime_state.cc
@@ -273,7 +273,10 @@ static void ForceJitCompiled(Thread* self,
// Update the code cache to make sure the JIT code does not get deleted.
// Note: this will apply to all JIT compilations.
code_cache->SetGarbageCollectCode(false);
- if (kind == CompilationKind::kBaseline || jit->GetJitCompiler()->IsBaselineCompiler()) {
+ if (jit->JitAtFirstUse()) {
+ ScopedObjectAccess soa(self);
+ jit->CompileMethod(method, self, kind, /*prejit=*/ false);
+ } else if (kind == CompilationKind::kBaseline || jit->GetJitCompiler()->IsBaselineCompiler()) {
ScopedObjectAccess soa(self);
if (jit->TryPatternMatch(method, CompilationKind::kBaseline)) {
return;