Skip to content

Commit

Permalink
Restrict LARL-use in genLoadAddressConstant
Browse files Browse the repository at this point in the history
Don't generate PC-relative instructions for remote
compilations.

Signed-off-by: Dhruv Chopra <Dhruv.C.Chopra@ibm.com>
  • Loading branch information
dchopra001 committed Sep 2, 2020
1 parent a42b150 commit e855952
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions compiler/z/codegen/OMRTreeEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,16 @@ genLoadAddressConstant(TR::CodeGenerator * cg, TR::Node * node, uintptr_t value,
if (node->isClassUnloadingConst())
{
uintptr_t value = node->getAddress();
TR::Instruction *unloadableConstInstr = generateRILInstruction(cg, TR::InstOpCode::LARL, node, targetRegister, reinterpret_cast<void*>(value));
TR_OpaqueClassBlock* unloadableClass = NULL;
TR::Instruction *unloadableConstInstr = NULL;
if (cg->canUseRelativeLongInstructions(value))
{
unloadableConstInstr = generateRILInstruction(cg, TR::InstOpCode::LARL, node, targetRegister, reinterpret_cast<void*>(value));
}
else
{
unloadableConstInstr = genLoadAddressConstantInSnippet(cg, node, value, targetRegister, NULL, NULL, NULL, true);
}

if (node->isMethodPointerConstant())
{
comp->getStaticMethodPICSites()->push_front(unloadableConstInstr);
Expand Down

0 comments on commit e855952

Please sign in to comment.