Skip to content

8372268: [lworld] Keep buffer oop on scalarized calls#2062

Open
rwestrel wants to merge 24 commits intoopenjdk:lworldfrom
rwestrel:JDK-8372268
Open

8372268: [lworld] Keep buffer oop on scalarized calls#2062
rwestrel wants to merge 24 commits intoopenjdk:lworldfrom
rwestrel:JDK-8372268

Conversation

@rwestrel
Copy link
Copy Markdown
Collaborator

@rwestrel rwestrel commented Feb 6, 2026

This implements c2 and runtime support to pass a reference to an existing buffer, if there's one, as part of the scalarized calling convention. The buffer reference and the null marker are both always passed at this point.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (1 review required, with at least 1 Committer)

Issue

  • JDK-8372268: [lworld] Keep buffer oop on scalarized calls (Enhancement - P2)

Contributors

  • Galder Zamarreño <galder@openjdk.org>

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/valhalla.git pull/2062/head:pull/2062
$ git checkout pull/2062

Update a local copy of the PR:
$ git checkout pull/2062
$ git pull https://git.openjdk.org/valhalla.git pull/2062/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2062

View PR using the GUI difftool:
$ git pr show -t 2062

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/2062.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper bot commented Feb 6, 2026

👋 Welcome back roland! A progress list of the required criteria for merging this PR into lworld will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link
Copy Markdown

openjdk bot commented Feb 6, 2026

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk
Copy link
Copy Markdown

openjdk bot commented Feb 11, 2026

⚠️ @rwestrel This pull request contains merges that bring in commits not present in the target repository. Since this is not a "merge style" pull request, these changes will be squashed when this pull request in integrated. If this is your intention, then please ignore this message. If you want to preserve the commit structure, you must change the title of this pull request to Merge <project>:<branch> where <project> is the name of another project in the OpenJDK organization (for example Merge jdk:master).

@rwestrel
Copy link
Copy Markdown
Collaborator Author

/contributor add @galderz

@openjdk
Copy link
Copy Markdown

openjdk bot commented Mar 16, 2026

@rwestrel
Contributor Galder Zamarreño <galder@openjdk.org> successfully added.

@rwestrel rwestrel marked this pull request as ready for review March 16, 2026 13:27
@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 16, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge bot commented Mar 16, 2026

Webrevs

Copy link
Copy Markdown
Member

@TobiHartmann TobiHartmann left a comment

Choose a reason for hiding this comment

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

Nice work Roland - thanks for taking care of this! Overall, this looks good to me. Could you resolve the merge conflict?

}

MemoryMXBean mem = ManagementFactory.getMemoryMXBean();
System.out.println("Heap size: " + mem.getHeapMemoryUsage().getUsed() / (1024*1024) + " MB");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we assert some max heap size here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I wondered about that. Isn't there a risk that the test becomes fragile? What would you pick?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think if the difference of the heap size with and without your fix is large, we can just pick a large enough value for the assert that would then trigger without your fix and still be large enough to account for fluctuations.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

To avoid timeouts, I decreased the number of iterations and the test runs with -Xmx20M. I think it reports 2MB being used with my patch. So if memory usage increases for some reason, it's very likely to cause an OOME. Do you still think an assert is needed?

// Insert InlineTypeNode::NullMarker field right after T_METADATA delimiter
_sig_cc->insert_before(last+1, SigEntry(T_BOOLEAN, -1, nullptr, true));
_sig_cc_ro->insert_before(last_ro+1, SigEntry(T_BOOLEAN, -1, nullptr, true));
if (bt == T_OBJECT) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this needed?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It's not

Co-authored-by: Tobias Hartmann <tobias.hartmann@oracle.com>
@openjdk
Copy link
Copy Markdown

openjdk bot commented Mar 19, 2026

@rwestrel this pull request can not be integrated into lworld due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout JDK-8372268
git fetch https://git.openjdk.org/valhalla.git lworld
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge lworld"
git push

@openjdk openjdk bot added the merge-conflict Pull request has merge conflict with target branch label Mar 19, 2026
@rwestrel
Copy link
Copy Markdown
Collaborator Author

Nice work Roland - thanks for taking care of this! Overall, this looks good to me. Could you resolve the merge conflict?

The merge conflict must come from the backout of 8377882. I actually would need to make some tweaks to this one now that JDK-8377882 is no longer there and then once the redo of JDK-8377882 integrates, I would have to tweak it again. So I would rather wait until the redo is integrated to merge.

@TobiHartmann
Copy link
Copy Markdown
Member

Sounds good!

@openjdk openjdk bot removed the merge-conflict Pull request has merge conflict with target branch label Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

2 participants