Skip to content

Commit

Permalink
Create OMR::Node::storeToAddressField() helper
Browse files Browse the repository at this point in the history
  • Loading branch information
gita-omr committed Nov 6, 2024
1 parent e59f482 commit 01ebad9
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
24 changes: 24 additions & 0 deletions compiler/il/OMRNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7727,3 +7727,27 @@ OMR::Node::isEAEscapeHelperCall()

return false;
}


TR::Node *
OMR::Node::storeToAddressField(TR::Node *obj, TR::SymbolReference *symRef, TR::Node *value)
{
TR::Compilation *comp = TR::comp();
TR::Node * node;

if (TR::Compiler->om.writeBarrierType() != gc_modron_wrtbar_none)
{
node = TR::Node::createWithSymRef(TR::awrtbari, 3, 3, obj, value, obj, symRef);
}
else
{
node = TR::Node::createWithSymRef(TR::astorei, 2, 2, obj, value, symRef);
}

if (comp->useCompressedPointers())
{
node = TR::Node::createCompressedRefsAnchor(node);
}

return node;
}
19 changes: 19 additions & 0 deletions compiler/il/OMRNode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,25 @@ class OMR_EXTENSIBLE Node
*/
bool isEAEscapeHelperCall();

/**
* \brief
* Creates a node for storing into an address field of an object
*
* \parm obj
* Node containing object reference
*
* \parm symRef
* Symbol reference of the address field
*
* \parm value
* Value to store
*
* \return
* Created node
*
*/
static TR::Node * storeToAddressField(TR::Node *obj, TR::SymbolReference *symRef, TR::Node *value);

TR_YesNoMaybe hasBeenRun();

/// Given a monenter node, return the persistent class identifer that's being synchronized
Expand Down

0 comments on commit 01ebad9

Please sign in to comment.