From 9d4c2531c3c5bd8b21390179242beec687973783 Mon Sep 17 00:00:00 2001 From: Christian Despres Date: Fri, 29 Nov 2024 08:04:41 -0500 Subject: [PATCH] Notify dependency table at method queue time Currently, methods with unsatisfied dependencies may still have loads attempted for them. This can happen if their counts reach zero very quickly. Since this is the case, methods that are about to be queued for compilation no longer need to be tracked in the method dependency table. Signed-off-by: Christian Despres --- runtime/compiler/control/CompilationThread.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/runtime/compiler/control/CompilationThread.cpp b/runtime/compiler/control/CompilationThread.cpp index 2a3f77c5ed8..3c7ff825209 100644 --- a/runtime/compiler/control/CompilationThread.cpp +++ b/runtime/compiler/control/CompilationThread.cpp @@ -5059,6 +5059,11 @@ TR::CompilationInfo::addMethodToBeCompiled(TR::IlGeneratorMethodDetails & detail Trc_JIT_CompRequest(vmThread, method, pc, !async, optimizationPlan->getOptLevel(), (int)priority, _numQueuedMethods); + // If method is going to be compiled, then the dependency table no longer needs to + // track it. Let the table know. + if (auto dependencyTable = getPersistentInfo()->getAOTDependencyTable()) + dependencyTable->methodWillBeCompiled(method); + // Increase the queue weight uint8_t entryWeight; // must be less than 256 if (!details.isOrdinaryMethod() || details.isNewInstanceThunk() || isJNINativeMethodRequest) @@ -8254,11 +8259,6 @@ TR::CompilationInfoPerThreadBase::compile(J9VMThread * vmThread, vmThread->omrVMThread->vmState = J9VMSTATE_JIT | J9VMSTATE_MINOR; vmThread->jitMethodToBeCompiled = method; - // If method is being compiled, then the dependency table no longer needs to - // track it. Let the table know. - if (auto dependencyTable = getCompilationInfo()->getPersistentInfo()->getAOTDependencyTable()) - dependencyTable->methodWillBeCompiled(method); - try { TR::RawAllocator rawAllocator(vmThread->javaVM);