Skip to content

Commit

Permalink
Merge pull request #7473 from a7ehuo/update-system-arraycopy-alias-2
Browse files Browse the repository at this point in the history
Update System.arraycopy and intrinsics alias
  • Loading branch information
vijaysun-omr authored Sep 27, 2024
2 parents a4c1af2 + b67acad commit fa23d1b
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 fa23d1b

Please sign in to comment.