Skip to content

Commit

Permalink
Update System.arraycopy and intrinsics alias
Browse files Browse the repository at this point in the history
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 <Annabelle.Huo@ibm.com>
  • Loading branch information
a7ehuo committed Sep 27, 2024
1 parent 9b3e65e commit b67acad
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions compiler/il/Aliases.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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() ||
Expand Down Expand Up @@ -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());
}
Expand Down

0 comments on commit b67acad

Please sign in to comment.