Skip to content

8384107: [lworld] Update runtime/contended tests to run the same testing for value classes#2413

Open
shivshah-oracle wants to merge 3 commits into
openjdk:lworldfrom
shivshah-oracle:JDK-8384107
Open

8384107: [lworld] Update runtime/contended tests to run the same testing for value classes#2413
shivshah-oracle wants to merge 3 commits into
openjdk:lworldfrom
shivshah-oracle:JDK-8384107

Conversation

@shivshah-oracle
Copy link
Copy Markdown
Contributor

@shivshah-oracle shivshah-oracle commented May 8, 2026

Added OopMapsValue and OopMapsSameGroupValue, mirrors OopMaps tests using Integer instances to test contended oop maps with value class objects.


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-8384107: [lworld] Update runtime/contended tests to run the same testing for value classes (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2413

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented May 8, 2026

👋 Welcome back shivshah-oracle! 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 May 8, 2026

@shivshah-oracle 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:

8384107: [lworld] Update runtime/contended tests to run the same testing for value classes

Reviewed-by: fparain

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 213 new commits pushed to the lworld branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this 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 (@fparain) 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).

@shivshah-oracle shivshah-oracle changed the title 8384107: Update runtime/contended tests to run the same testing for value classes 8384107: [lworld] Update runtime/contended tests to run the same testing for value classes May 8, 2026
@shivshah-oracle shivshah-oracle marked this pull request as ready for review May 12, 2026 13:45
@openjdk openjdk Bot added the rfr Pull request is ready for review label May 12, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge Bot commented May 12, 2026

Webrevs

@fparain
Copy link
Copy Markdown
Collaborator

fparain commented May 12, 2026

As they are currently written, these tests don't exercise interactions between contended or oopmap code and value types. The classes with @Contended annotations are using j.l.Object typed fields, which the VM handles as regular reference fields, not values, for both layout decisions and oopmap generation.

To test interactions between @Contended and value fields, I'd recommend declaring a small value types, less than 56 bits, so it can be flattened (the declared value class Point with two int fields is too big to be flattened), and then declare contended fields using the exact type of the field, not a super type.

To test contended/value types/oopmap interactions, I'd recommend to declare a value type containing a reference type and a small primitive type (for instance value record Opt(Object o, boolean b) { } ), and then declare contended fields of this exact type. This kind of value type would be flattened in VMs using compressed oops, and not flattened in VMs using full size oops, creating two distinct patterns of field layouts including oops and contended padding.

@shivshah-oracle
Copy link
Copy Markdown
Contributor Author

As they are currently written, these tests don't exercise interactions between contended or oopmap code and value types. The classes with @Contended annotations are using j.l.Object typed fields, which the VM handles as regular reference fields, not values, for both layout decisions and oopmap generation.

To test interactions between @Contended and value fields, I'd recommend declaring a small value types, less than 56 bits, so it can be flattened (the declared value class Point with two int fields is too big to be flattened), and then declare contended fields using the exact type of the field, not a super type.

To test contended/value types/oopmap interactions, I'd recommend to declare a value type containing a reference type and a small primitive type (for instance value record Opt(Object o, boolean b) { } ), and then declare contended fields of this exact type. This kind of value type would be flattened in VMs using compressed oops, and not flattened in VMs using full size oops, creating two distinct patterns of field layouts including oops and contended padding.

Updated using Small(int x) for flattened value fields and Opt(Object o, boolean b) for oop map interaction testing, with exact types on all @contended fields.

Copy link
Copy Markdown
Collaborator

@fparain fparain left a comment

Choose a reason for hiding this comment

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

Looks good to me.
Thank you for the changes.

@openjdk openjdk Bot added the ready Pull request is ready to be integrated label May 14, 2026
@shivshah-oracle
Copy link
Copy Markdown
Contributor Author

/integrate

@openjdk openjdk Bot added the sponsor Pull request is ready to be sponsored label May 15, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 15, 2026

@shivshah-oracle
Your change (at version 32a4863) is now ready to be sponsored by a Committer.

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

Labels

ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored

Development

Successfully merging this pull request may close these issues.

2 participants