Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add contiguous array dataAddr field shadow symbol reference for off heap technology #7150

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
21 changes: 21 additions & 0 deletions compiler/compile/OMRSymbolReferenceTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,26 @@ OMR::SymbolReferenceTable::findOrCreateContiguousArraySizeSymbolRef()
return element(contiguousArraySizeSymbol);
}

#if defined(J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION)
TR::SymbolReference *
OMR::SymbolReferenceTable::findOrCreateContiguousArrayDataAddrFieldShadowSymRef()
{
if (!element(contiguousArrayDataAddrFieldSymbol))
{
TR::Symbol * sym = TR::Symbol::createShadow(trHeapMemory(), TR::Address);
sym->setContiguousArrayDataAddrFieldSymbol();
element(contiguousArrayDataAddrFieldSymbol) = new (trHeapMemory()) TR::SymbolReference(self(), contiguousArrayDataAddrFieldSymbol, sym);
element(contiguousArrayDataAddrFieldSymbol)->setOffset(TR::Compiler->om.offsetOfContiguousDataAddrField());
}
return element(contiguousArrayDataAddrFieldSymbol);
}
#endif // defined(J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION)

TR::SymbolReference *
OMR::SymbolReferenceTable::findContiguousArrayDataAddrFieldShadowSymRef()
{
return element(contiguousArrayDataAddrFieldSymbol);
}

TR::SymbolReference *
OMR::SymbolReferenceTable::findOrCreateVftSymbolRef()
Expand Down Expand Up @@ -2152,6 +2172,7 @@ const char *OMR::SymbolReferenceTable::_commonNonHelperSymbolNames[] =
"<osrScratchBuffer>",
"<osrFrameIndex>",
"<osrReturnAddress>",
"<contiguousArrayDataAddrField>",
"<potentialOSRPointHelper>",
"<osrFearPointHelper>",
"<eaEscapeHelper>",
Expand Down
5 changes: 5 additions & 0 deletions compiler/compile/OMRSymbolReferenceTable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ class SymbolReferenceTable
osrScratchBufferSymbol, //osrScratchBuffer slot on j9vmthread
osrFrameIndexSymbol, // osrFrameIndex slot on j9vmthread
osrReturnAddressSymbol, // osrFrameIndex slot on j9vmthread
contiguousArrayDataAddrFieldSymbol, // dataAddr field symbol used to track data portion of the array

/** \brief
*
Expand Down Expand Up @@ -803,6 +804,10 @@ class SymbolReferenceTable
TR::SymbolReference * findOrCreateTemporaryWithKnowObjectIndex(TR::ResolvedMethodSymbol * owningMethodSymbol, TR::KnownObjectTable::Index knownObjectIndex);
TR::SymbolReference * findOrCreateThisRangeExtensionSymRef(TR::ResolvedMethodSymbol *owningMethodSymbol = 0);
TR::SymbolReference * findOrCreateContiguousArraySizeSymbolRef();
#if defined(J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION)
TR::SymbolReference * findOrCreateContiguousArrayDataAddrFieldShadowSymRef();
#endif // defined(J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION)
TR::SymbolReference * findContiguousArrayDataAddrFieldShadowSymRef();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the findOrCreate inside an ifdef but the find routine is not ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about the delay, I must have missed the email for comment. But findOrCreate routine uses TR::Compiler->om.offsetOfContiguousDataAddrField API which needs to be guarded by ifdef. However, find isn't guarded because it is used by node->isDataAddrPointer(). I left find outside to avoid having ifdef in node->isDataAddrPointer().

TR::SymbolReference * findOrCreateNewArrayNoZeroInitSymbolRef(TR::ResolvedMethodSymbol * owningMethodSymbol);
TR::SymbolReference * findOrCreateNewObjectSymbolRef(TR::ResolvedMethodSymbol * owningMethodSymbol);
TR::SymbolReference * findOrCreateNewObjectNoZeroInitSymbolRef(TR::ResolvedMethodSymbol * owningMethodSymbol);
Expand Down
8 changes: 8 additions & 0 deletions compiler/il/OMRNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5898,6 +5898,14 @@ OMR::Node::setIsInternalPointer(bool v)
_flags.set(internalPointer, v);
}

bool
OMR::Node::isDataAddrPointer()
{
return self()->getOpCodeValue() == TR::aloadi
&& self()->getOpCode().hasSymbolReference()
&& self()->getSymbolReference() == TR::comp()->getSymRefTab()->findContiguousArrayDataAddrFieldShadowSymRef();
}

bool
OMR::Node::isArrayTRT()
{
Expand Down
3 changes: 3 additions & 0 deletions compiler/il/OMRNode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1152,6 +1152,9 @@ class OMR_EXTENSIBLE Node
bool isInternalPointer();
void setIsInternalPointer(bool v);

// Flag used by TR::aloadi
bool isDataAddrPointer();

// Flags used by TR::arraytranslate and TR::arraytranslateAndTest
bool isArrayTRT();
void setArrayTRT(bool v);
Expand Down
5 changes: 4 additions & 1 deletion compiler/il/OMRSymbol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,9 @@ class OMR_EXTENSIBLE Symbol
inline void setArrayShadowSymbol();
inline bool isArrayShadowSymbol();

inline void setContiguousArrayDataAddrFieldSymbol();
inline bool isContiguousArrayDataAddrFieldSymbol();

inline bool isRecognizedShadow();

inline bool isRecognizedKnownObjectShadow();
Expand Down Expand Up @@ -515,7 +518,7 @@ class OMR_EXTENSIBLE Symbol
///< to behave as regular locals to
///< preserve floating point semantics
PinningArrayPointer = 0x10000000,
// Available = 0x00020000,
contiguousArrayDataAddrField = 0x00020000,
AutoAddressTaken = 0x04000000, ///< a loadaddr of this auto exists
SpillTempLoaded = 0x04000000, ///< share bit with loadaddr because spill temps will never have their address taken. Used to remove store to spill if never loaded
// Available = 0x02000000,
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 @@ -427,6 +427,19 @@ OMR::Symbol::isArrayShadowSymbol()
return self()->isShadow() && _flags.testAny(ArrayShadow);
}


void
OMR::Symbol::setContiguousArrayDataAddrFieldSymbol()
{
_flags.set(contiguousArrayDataAddrField);
}

bool
OMR::Symbol::isContiguousArrayDataAddrFieldSymbol()
{
return _flags.testAny(contiguousArrayDataAddrField);
}

bool
OMR::Symbol::isRecognizedShadow()
{
Expand Down
3 changes: 3 additions & 0 deletions compiler/ras/Debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1667,6 +1667,8 @@ TR_Debug::getName(TR::SymbolReference * symRef)
return "<storeFlattenableArrayElementNonHelper>";
case TR::SymbolReferenceTable::J9JNIMethodIDvTableIndexFieldSymbol:
return "<J9JNIMethodIDvTableIndexFieldSymbol>";
case TR::SymbolReferenceTable::contiguousArrayDataAddrFieldSymbol:
return "<contiguousArrayDataAddrFieldSymbol>";
case TR::SymbolReferenceTable::defaultValueSymbol:
return "<defaultValue>";
case TR::SymbolReferenceTable::jitDispatchJ9MethodSymbol:
Expand Down Expand Up @@ -2111,6 +2113,7 @@ static const char *commonNonhelperSymbolNames[] =
"<osrScratchBuffer>",
"<osrFrameIndex>",
"<osrReturnAddress>",
"<contiguousArrayDataAddrField>",
"<potentialOSRPointHelper>",
"<osrFearPointHelper>",
"<eaEscapeHelper>",
Expand Down
Loading