Skip to content

Commit

Permalink
Add new needRelocationsForCurrentMethodPC query
Browse files Browse the repository at this point in the history
Signed-off-by: Dhruv Chopra <Dhruv.C.Chopra@ibm.com>
  • Loading branch information
dchopra001 committed Dec 4, 2019
1 parent d3f95fc commit b3b5d92
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions compiler/codegen/OMRCodeGenerator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,7 @@ class OMR_EXTENSIBLE CodeGenerator
bool needRelocationsForStatics() { return false; }
bool needRelocationsForBodyInfoData() { return false; }
bool needRelocationsForPersistentInfoData() { return false; }
bool needRelocationsForCurrentMethodPC() { return false; }

// This query can be used if we need to decide whether data represented by TR_HelperAddress or TR_AbsoluteHelperAddress
// relocation type needs a relocation record.
Expand Down
6 changes: 3 additions & 3 deletions compiler/p/codegen/OMRMemoryReference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1605,7 +1605,7 @@ void OMR::Power::MemoryReference::accessStaticItem(TR::Node *node, TR::SymbolRef
loadAddressConstant(cg, true, nodeForSymbol, 1, reg, NULL, false, TR_RamMethodSequence);
return;
}
else if (symbol->isStartPC() && (cg->comp()->compileRelocatableCode() || cg->comp()->isOutOfProcessCompilation()))
else if (symbol->isStartPC() && cg->needRelocationsForCurrentMethodPC())
{
// use inSnippet, as the relocation mechanism is already set up there
TR::Register *reg = _baseRegister = cg->allocateRegister();
Expand Down Expand Up @@ -1703,7 +1703,7 @@ void OMR::Power::MemoryReference::accessStaticItem(TR::Node *node, TR::SymbolRef
loadAddressConstant(cg, comp->compileRelocatableCode() || comp->isOutOfProcessCompilation(), nodeForSymbol, 0, reg, NULL, false, TR_RamMethodSequence);
return;
}
else if (symbol->isStartPC() && (ref->isUnresolved() || comp->compileRelocatableCode() || comp->isOutOfProcessCompilation()))
else if (symbol->isStartPC() && (ref->isUnresolved() || cg->needRelocationsForCurrentMethodPC()))
{
// use inSnippet, as the relocation mechanism is already set up there
TR::Register *reg = _baseRegister = cg->allocateRegister();
Expand All @@ -1716,7 +1716,7 @@ void OMR::Power::MemoryReference::accessStaticItem(TR::Node *node, TR::SymbolRef
loadAddressConstant(cg, true, nodeForSymbol, 1, reg, NULL, false, TR_DataAddress);
return;
}
else if (refIsUnresolved || useUnresSnippetToAvoidRelo && (comp->compileRelocatableCode() || comp->isOutOfProcessCompilation()))
else if (refIsUnresolved || useUnresSnippetToAvoidRelo)
{
self()->setUnresolvedSnippet(new (cg->trHeapMemory()) TR::UnresolvedDataSnippet(cg, node, ref, isStore, false));
cg->addSnippet(self()->getUnresolvedSnippet());
Expand Down

0 comments on commit b3b5d92

Please sign in to comment.