From b67acad90b8e6fd1a1f214d6c7598530770aa6bb Mon Sep 17 00:00:00 2001 From: Annabelle Huo Date: Wed, 25 Sep 2024 16:28:14 -0400 Subject: [PATCH] Update System.arraycopy and intrinsics alias Update System.arraycopy and intrinsics alias to be the same when HCR is enabled and when HCR is disabled since we already skip HCR guard for some JCL methods. Signed-off-by: Annabelle Huo --- compiler/il/Aliases.cpp | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/compiler/il/Aliases.cpp b/compiler/il/Aliases.cpp index d98399692bb..4a531aca2f0 100644 --- a/compiler/il/Aliases.cpp +++ b/compiler/il/Aliases.cpp @@ -440,22 +440,23 @@ OMR::SymbolReference::getUseDefAliasesBV(bool isDirectCall, bool includeGCSafePo #ifdef J9_PROJECT_SPECIFIC TR::ResolvedMethodSymbol * resolvedMethodSymbol = _symbol->castToResolvedMethodSymbol(); - if (!comp->getOption(TR_EnableHCR)) + if (resolvedMethodSymbol->getRecognizedMethod() == TR::java_lang_System_arraycopy) { - switch (resolvedMethodSymbol->getRecognizedMethod()) - { - case TR::java_lang_System_arraycopy: - { - TR_BitVector * aliases = new (aliasRegion) TR_BitVector(bvInitialSize, aliasRegion, growability); - *aliases |= symRefTab->aliasBuilder.arrayElementSymRefs(); - if (comp->generateArraylets()) - *aliases |= symRefTab->aliasBuilder.arrayletElementSymRefs(); - return aliases; - } + TR_BitVector * aliases = new (aliasRegion) TR_BitVector(bvInitialSize, aliasRegion, growability); + *aliases |= symRefTab->aliasBuilder.arrayElementSymRefs(); + if (comp->generateArraylets()) + *aliases |= symRefTab->aliasBuilder.arrayletElementSymRefs(); - if (resolvedMethodSymbol->isPureFunction()) - return NULL; + return aliases; + } + + if (!comp->getOption(TR_EnableHCR) || comp->fej9()->isIntrinsicCandidate(resolvedMethodSymbol->getResolvedMethod())) + { + if (resolvedMethodSymbol->isPureFunction()) + return NULL; + switch (resolvedMethodSymbol->getRecognizedMethod()) + { case TR::java_lang_Double_longBitsToDouble: case TR::java_lang_Double_doubleToLongBits: case TR::java_lang_Float_intBitsToFloat: @@ -501,9 +502,7 @@ OMR::SymbolReference::getUseDefAliasesBV(bool isDirectCall, bool includeGCSafePo break; } } -#endif //J9_PROJECT_SPECIFIC -#ifdef J9_PROJECT_SPECIFIC TR_ResolvedMethod * method = resolvedMethodSymbol->getResolvedMethod(); TR_PersistentMethodInfo * methodInfo = comp->getRecompilationInfo() ? TR_PersistentMethodInfo::get(method) : NULL; if (methodInfo && (methodInfo->hasRefinedAliasSets() || @@ -604,7 +603,7 @@ OMR::SymbolReference::getUseDefAliasesBV(bool isDirectCall, bool includeGCSafePo *aliases &= *methodAliases; return aliases; } -#endif +#endif //J9_PROJECT_SPECIFIC return symRefTab->aliasBuilder.methodAliases(self()); }