Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions compiler/compile/OMRSymbolReferenceTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1226,6 +1226,7 @@ OMR::SymbolReferenceTable::findOrCreateGCRPatchPointSymbolRef()
sym->setStaticAddress(0);
sym->setGCRPatchPoint(); // set the flag
sym->setNotDataAddress();
sym->setStaticAddressWithinMethodBounds();
element(gcrPatchPointSymbol) = new (trHeapMemory()) TR::SymbolReference(self(), gcrPatchPointSymbol, sym);
}
return element(gcrPatchPointSymbol);
Expand All @@ -1241,6 +1242,7 @@ OMR::SymbolReferenceTable::findOrCreateStartPCSymbolRef()
sym->setStaticAddress(0);
sym->setStartPC();
sym->setNotDataAddress();
sym->setStaticAddressWithinMethodBounds();
element(startPCSymbol) = new (trHeapMemory()) TR::SymbolReference(self(), startPCSymbol, sym);
}
return element(startPCSymbol);
Expand Down
4 changes: 4 additions & 0 deletions compiler/il/OMRSymbol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,9 @@ class OMR_EXTENSIBLE Symbol
inline void setConstantPoolAddress();
inline bool isConstantPoolAddress();

inline void setStaticAddressWithinMethodBounds();
inline bool isStaticAddressWithinMethodBounds();

// flag methods specific to resolved
//
inline bool isJittedMethod();
Expand Down Expand Up @@ -516,6 +519,7 @@ class OMR_EXTENSIBLE Symbol
CountForRecompile = 0x02000000,
RecompilationCounter = 0x01000000,
GCRPatchPoint = 0x00400000,
StaticAddressWithinMethodBounds = 0x00800000, // Address is inside a method body and can be accessed with RIP addressing without relocations

//Only Used by Symbols for which isResolvedMethod is true;
IsJittedMethod = 0x80000000,
Expand Down
13 changes: 13 additions & 0 deletions compiler/il/OMRSymbol_inlines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,19 @@ OMR::Symbol::setConstantPoolAddress()
_flags.set(ConstantPoolAddress);
}

bool
OMR::Symbol::isStaticAddressWithinMethodBounds()
{
return self()->isStatic() && _flags.testAny(StaticAddressWithinMethodBounds);
}

void
OMR::Symbol::setStaticAddressWithinMethodBounds()
{
TR_ASSERT(self()->isStatic(), "Symbol must be static");
_flags.set(StaticAddressWithinMethodBounds);
}

bool
OMR::Symbol::isConstMethodHandle()
{
Expand Down
2 changes: 1 addition & 1 deletion compiler/x/amd64/codegen/OMRMemoryReference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ bool OMR::X86::AMD64::MemoryReference::needsAddressLoadInstruction(intptr_t next
return true; // If a class gets replaced, it may no longer fit in an immediate
else if (IS_32BIT_SIGNED(displacement))
return false;
else if (cg->comp()->isOutOfProcessCompilation() && sr.getSymbol() && sr.getSymbol()->isStatic() && !sr.getSymbol()->isNotDataAddress())
else if (cg->comp()->isOutOfProcessCompilation() && sr.getSymbol() && sr.getSymbol()->isStatic() && !sr.getSymbol()->isStaticAddressWithinMethodBounds())
return true;
else if (IS_32BIT_RIP(displacement, nextInstructionAddress))
return false;
Expand Down