From ae32250d6ca3a167855e4f7908fcf39fe287aac9 Mon Sep 17 00:00:00 2001 From: Christian Despres Date: Thu, 31 Aug 2023 14:09:17 +0000 Subject: [PATCH] Store JITServer AOT methods if they are delayed If the option -XX:+JITServerAOTCacheDelayMethodRelocation is in effect, then we delay the relocation of received AOT methods by default. When this is the case, we should also store these methods in the local SCC so that they will be available to be relocated later. Signed-off-by: Christian Despres --- runtime/compiler/control/JITClientCompilationThread.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/runtime/compiler/control/JITClientCompilationThread.cpp b/runtime/compiler/control/JITClientCompilationThread.cpp index 6fb3f93f327..8e43bbf1335 100644 --- a/runtime/compiler/control/JITClientCompilationThread.cpp +++ b/runtime/compiler/control/JITClientCompilationThread.cpp @@ -2969,7 +2969,12 @@ remoteCompilationEnd(J9VMThread *vmThread, TR::Compilation *comp, TR_ResolvedMet } #endif /* J9VM_INTERP_AOT_RUNTIME_SUPPORT */ - if (!compInfo->getPersistentInfo()->getJITServerUseAOTCache() || shouldStoreRemoteAOTMethods) + // If we're not using the AOT cache, we still store by default. This avoids certain test failures in the short term. + // Also, if we've explicitly been requested by the user to delay method relocations then we need to store methods + // in the SCC to support that option. + if (comp->getPersistentInfo()->getJITServerAOTCacheDelayMethodRelocation() || + !compInfo->getPersistentInfo()->getJITServerUseAOTCache() || + shouldStoreRemoteAOTMethods) { J9ROMMethod *romMethod = comp->fej9()->getROMMethodFromRAMMethod(method); TR::CompilationInfo::storeAOTInSharedCache(