Skip to content

Commit 494d6eb

Browse files
authored
Merge pull request #190 from Akira1Saitoh/aarch64IfcmpAconst042
(0.42) AArch64: Add class unload pic to class constant under ifacmp node
2 parents d810fcb + 17f034d commit 494d6eb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

compiler/aarch64/codegen/ControlFlowEvaluator.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ static TR::Instruction *ificmpHelper(TR::Node *node, TR::ARM64ConditionCode cc,
155155
TR::RegisterDependencyConditions *deps;
156156
bool secondChildNeedsRelocation = cg->profiledPointersRequireRelocation() && (secondChild->getOpCodeValue() == TR::aconst) &&
157157
(secondChild->isClassPointerConstant() || secondChild->isMethodPointerConstant());
158+
TR_ResolvedMethod *method = comp->getCurrentMethod();
159+
bool secondChildNeedsPicSite = (secondChild->getOpCodeValue() == TR::aconst) &&
160+
((secondChild->isClassPointerConstant() && cg->fe()->isUnloadAssumptionRequired(reinterpret_cast<TR_OpaqueClassBlock *>(secondChild->getAddress()), method)) ||
161+
(node->isMethodPointerConstant() && cg->fe()->isUnloadAssumptionRequired(
162+
cg->fe()->createResolvedMethod(cg->trMemory(), reinterpret_cast<TR_OpaqueMethodBlock *>(secondChild->getAddress()), method)->classOfMethod(), method)));
158163

159164
#ifdef J9_PROJECT_SPECIFIC
160165
if (secondChildNeedsRelocation)
@@ -226,7 +231,7 @@ if (secondChildNeedsRelocation)
226231
}
227232
}
228233

229-
if ((!secondChildNeedsRelocation) && secondChild->getOpCode().isLoadConst() && secondChild->getRegister() == NULL)
234+
if ((!secondChildNeedsRelocation) && (!secondChildNeedsPicSite) && secondChild->getOpCode().isLoadConst() && secondChild->getRegister() == NULL)
230235
{
231236
int64_t value = is64bit ? secondChild->getLongInt() : secondChild->getInt();
232237
if (constantIsUnsignedImm12(value) || constantIsUnsignedImm12(-value) ||

0 commit comments

Comments
 (0)