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

Disable commoning of dataAddr Pointer in createStoresForVar() #7476

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

midronij
Copy link
Contributor

@midronij midronij commented Oct 2, 2024

This contribution includes the following changes:

  • An addendum to c86da7e
  • Replaced uses of J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION in setmemoryEvaluator() with OMR_GC_SPARSE_HEAP_ALLOCATION

@midronij
Copy link
Contributor Author

midronij commented Oct 2, 2024

@zl-wang @rmnattas here's the stackwalk fix!

if (child->isDataAddrPointer())
{
arrayLoadNode = TR::Node::createLoad(arrayObjectNode, newArrayRef);
child->setAndIncChild(0, arrayLoadNode);
Copy link
Contributor

Choose a reason for hiding this comment

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

you are changing the grand-child array object load to the pinning-array local load, but i didn't see previous code (for non-offheap case) changing the child into the corresponding pinning array local load. is it done somewhere else?

I would like to ask @vijaysun-omr for a review too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My intent was take a similar approach to what was done in c86da7e:

omr/compiler/il/OMRNode.cpp

Lines 3788 to 3800 in fa23d1b

if (self()->isDataAddrPointer())
{
TR::Node *firstChild = self()->getFirstChild();
TR::Node *arrayLoadNode = NULL;
TR::SymbolReference *newArrayRef = comp->getSymRefTab()->createTemporary(comp->getMethodSymbol(), TR::Address);
TR::Node *newStore = TR::Node::createStore(newArrayRef, firstChild);
TR::TreeTop *newStoreTree = TR::TreeTop::create(comp, newStore);
insertBefore = origInsertBefore->insertBefore(newStoreTree);
arrayLoadNode = TR::Node::createLoad(firstChild, newArrayRef);
self()->setAndIncChild(0, arrayLoadNode);
firstChild->recursivelyDecReferenceCount();
return insertBefore;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with Julian that we probably don't need to change the child to be a load of the newly created temp (the code after line 3927). It probably doesn't hurt doing so either. If you have time to test without the changes to use the load, that may be worth it to minimize what is being changed.

Use OMR_GC_SPARSE_HEAP_ALLOCATION instead of
J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION in setmemoryEvaluator.

Signed-off-by: midronij <[email protected]>
@zl-wang
Copy link
Contributor

zl-wang commented Oct 8, 2024

@hzongaro for a review

Copy link
Member

@hzongaro hzongaro left a comment

Choose a reason for hiding this comment

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

I think the change looks fine. Just one suggestion for readability.

Also, may I ask you to update the comment for commit de2996e to provide a little more detail regarding the reason for the change?

arrayObjectNode = child->getFirstChild();

newArrayRef = comp->getSymRefTab()->createTemporary(comp->getMethodSymbol(), TR::Address);
TR::Node *newStore = TR::Node::createStore(newArrayRef, arrayObjectNode ? arrayObjectNode : child);
Copy link
Member

Choose a reason for hiding this comment

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

This tests whether arrayObjectNode is non-null in deciding whether to use arrayObjectNode or child, but the condition on the if statement below uses child->isDataAddrPointer() again. It might be easier to read if both used the same condition - I have a slight preference for child->isDataAddrPointer() to make it more obvious arrayObjectNode will be operated set or referenced in all three places.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants