Skip to content

8353182: [lworld] C2: Multiple IR test failures in compiler/gcbarriers/TestZGCBarrierElision.java after JDK-8351569 #1497

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

Closed
wants to merge 2 commits into from

Conversation

dafedafe
Copy link
Contributor

@dafedafe dafedafe commented Jul 2, 2025

This is a very similar issue to JDK-8343420.

A few TestZGCBarrierElision tests fail after JDK-8351569. These tests check that ZGC barrier elision optimization does not elide necessary barriers and partially do so using VarHandle::getAndSet and checking that GetAndSetP nodes with barriers are created.
As found out in JDK-8343420, JDK-8351569 refactored Unsafe::getAndSet (which is used by VarHandle::getAndSet) to take value-classes into account, which implies that checks must be introduced to see if the target and argument objects are value-classes. This is done with a new overloaded getAndSet method that is now called instead of the old one. This method is not intrinsified (only inlined) and doesn't result in a GetAndSet node. It instead relies on the compareAndSet method (which gets intrinsified) and results in a CompareAndSwap node.

Here as well, as the goal of the test is mainly to check for ZGC barrier presence, the sensible fix for now seems to be to modify the TestZGCBarrierElision tests to make them check for CompareAndSwap instead of GetAndSet nodes.

Tests: Tier 1-3+


Progress

  • Change must not contain extraneous whitespace

Issue

  • JDK-8353182: [lworld] C2: Multiple IR test failures in compiler/gcbarriers/TestZGCBarrierElision.java after JDK-8351569 (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1497

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

Using diff file

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

Using Webrev

Link to Webrev Comment

…riers/TestZGCBarrierElision.java after JDK-8351569
@bridgekeeper
Copy link

bridgekeeper bot commented Jul 2, 2025

👋 Welcome back dfenacci! 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

openjdk bot commented Jul 2, 2025

@dafedafe This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8353182: [lworld] C2: Multiple IR test failures in compiler/gcbarriers/TestZGCBarrierElision.java after JDK-8351569

Reviewed-by: thartmann

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been no new commits pushed to the lworld branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@TobiHartmann) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot changed the title JDK-8353182: [lworld] C2: Multiple IR test failures in compiler/gcbarriers/TestZGCBarrierElision.java after JDK-8351569 8353182: [lworld] C2: Multiple IR test failures in compiler/gcbarriers/TestZGCBarrierElision.java after JDK-8351569 Jul 2, 2025
@openjdk
Copy link

openjdk bot commented Jul 2, 2025

@dafedafe 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-8353182
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

@dafedafe dafedafe marked this pull request as ready for review July 2, 2025 13:03
@openjdk openjdk bot added the rfr label Jul 2, 2025
@mlbridge
Copy link

mlbridge bot commented Jul 2, 2025

Webrevs

@openjdk openjdk bot added ready and removed merge-conflict labels Jul 2, 2025
Copy link
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.

Thanks again Damon. Looks good to me!

@dafedafe
Copy link
Contributor Author

dafedafe commented Jul 2, 2025

Thanks for your review @TobiHartmann.

@dafedafe
Copy link
Contributor Author

dafedafe commented Jul 2, 2025

/integrate

@openjdk openjdk bot added the sponsor label Jul 2, 2025
@openjdk
Copy link

openjdk bot commented Jul 2, 2025

@dafedafe
Your change (at version b3ab62f) is now ready to be sponsored by a Committer.

@TobiHartmann
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Jul 3, 2025

Going to push as commit ed2a03e.
Since your change was applied there have been 2 commits pushed to the lworld branch:

  • bdfe15a: 8361302:
  • 6541b8b: 8346307: [lworld] Clarify identity vs value in Class, Objects, and document limitations of value objects

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated label Jul 3, 2025
@openjdk openjdk bot closed this Jul 3, 2025
@openjdk
Copy link

openjdk bot commented Jul 3, 2025

@TobiHartmann @dafedafe Pushed as commit ed2a03e.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

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

Successfully merging this pull request may close these issues.

2 participants