Skip to content

Commit

Permalink
Merge pull request #7206 from Akira1Saitoh/aarch64IfcmpAconst
Browse files Browse the repository at this point in the history
AArch64: Add class unload pic to class constant under ifacmp node
  • Loading branch information
knn-k authored Dec 14, 2023
2 parents a4c2021 + 67d3ec5 commit 5943f0e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion compiler/aarch64/codegen/ControlFlowEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ static TR::Instruction *ificmpHelper(TR::Node *node, TR::ARM64ConditionCode cc,
TR::RegisterDependencyConditions *deps;
bool secondChildNeedsRelocation = cg->profiledPointersRequireRelocation() && (secondChild->getOpCodeValue() == TR::aconst) &&
(secondChild->isClassPointerConstant() || secondChild->isMethodPointerConstant());
TR_ResolvedMethod *method = comp->getCurrentMethod();
bool secondChildNeedsPicSite = (secondChild->getOpCodeValue() == TR::aconst) &&
((secondChild->isClassPointerConstant() && cg->fe()->isUnloadAssumptionRequired(reinterpret_cast<TR_OpaqueClassBlock *>(secondChild->getAddress()), method)) ||
(node->isMethodPointerConstant() && cg->fe()->isUnloadAssumptionRequired(
cg->fe()->createResolvedMethod(cg->trMemory(), reinterpret_cast<TR_OpaqueMethodBlock *>(secondChild->getAddress()), method)->classOfMethod(), method)));

#ifdef J9_PROJECT_SPECIFIC
if (secondChildNeedsRelocation)
Expand Down Expand Up @@ -226,7 +231,7 @@ if (secondChildNeedsRelocation)
}
}

if ((!secondChildNeedsRelocation) && secondChild->getOpCode().isLoadConst() && secondChild->getRegister() == NULL)
if ((!secondChildNeedsRelocation) && (!secondChildNeedsPicSite) && secondChild->getOpCode().isLoadConst() && secondChild->getRegister() == NULL)
{
int64_t value = is64bit ? secondChild->getLongInt() : secondChild->getInt();
if (constantIsUnsignedImm12(value) || constantIsUnsignedImm12(-value) ||
Expand Down

0 comments on commit 5943f0e

Please sign in to comment.