Skip to content

8387192: [lworld] Review comment drop for core libs#2576

Closed
liach wants to merge 4 commits into
openjdk:lworldfrom
liach:cleanup/lw-reviews-0
Closed

8387192: [lworld] Review comment drop for core libs#2576
liach wants to merge 4 commits into
openjdk:lworldfrom
liach:cleanup/lw-reviews-0

Conversation

@liach

@liach liach commented Jun 24, 2026

Copy link
Copy Markdown
Member
  1. weakCompareAndSetReferenceXxx in Unsafe were delegating to wrong methods
  2. Replace use of 0 for reference layout with Unsafe.NON_FLAT_LAYOUT
  3. Replace use of 31 - Integer.numberOfLeadingZeros(ascale) with numberOfTrailingZeros
  4. Remove null check for VarHandle getting from NR fields (parity with ArrayVarHandle and DirectMethodHandle), add missing null check for flat value var handles
  5. Remove the weird directives and old flags of RecursiveValueClass

Thanks to @JornVernee and @AlanBateman for spotting these issues.



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-8387192: [lworld] Review comment drop for core libs (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2576

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@liach liach changed the title Changes from review comments etc. 8387192 Jun 24, 2026
@bridgekeeper

bridgekeeper Bot commented Jun 24, 2026

Copy link
Copy Markdown

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

openjdk Bot commented Jun 24, 2026

Copy link
Copy Markdown

@liach 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:

8387192: [lworld] Review comment drop for core libs

Reviewed-by: jvernee, vromero

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 4 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.

➡️ To integrate this PR with the above commit message to the lworld branch, type /integrate in a new comment.

@openjdk openjdk Bot changed the title 8387192 8387192: [lworld] Review comment drop for core libs Jun 24, 2026
@liach liach marked this pull request as ready for review June 24, 2026 02:32
@openjdk openjdk Bot added the rfr Pull request is ready for review label Jun 24, 2026
@mlbridge

mlbridge Bot commented Jun 24, 2026

Copy link
Copy Markdown

Webrevs

Comment thread src/java.base/share/classes/java/io/ObjectStreamClass.java
Comment thread src/java.base/share/classes/java/lang/invoke/ArrayVarHandle.java
Comment thread src/java.base/share/classes/jdk/internal/misc/Unsafe.java
Comment thread src/java.base/share/classes/jdk/internal/misc/Unsafe.java

@viktorklang-ora viktorklang-ora left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM (after comments being handled)

Comment on lines -110 to -114
#if[Reference]
if (value == null && handle.nullRestricted) {
throw new NullPointerException("Uninitialized null-restricted field");
}
#end[Reference]

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.

Just for my understanding: why is it okay to remove this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The VM and low level libraries ensure null restricted fields never carry null upon write (with strict field initialization). The checks upon read are thus redundant. DirectMethodHandle getters and ArrayVarHandle both have no null check when they read values out of a null-restricted structure. So I think we don't need to be extra cautious here, too.

@vicente-romero-oracle vicente-romero-oracle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks sensible to me

@openjdk openjdk Bot added the ready Pull request is ready to be integrated label Jun 25, 2026
@liach

liach commented Jun 25, 2026

Copy link
Copy Markdown
Member Author

Thanks for the reviews!

/integrate

@openjdk

openjdk Bot commented Jun 25, 2026

Copy link
Copy Markdown

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

Your commit was automatically rebased without conflicts.

@openjdk openjdk Bot added the integrated Pull request has been integrated label Jun 25, 2026
@openjdk openjdk Bot closed this Jun 25, 2026
@openjdk openjdk Bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jun 25, 2026
@openjdk

openjdk Bot commented Jun 25, 2026

Copy link
Copy Markdown

@liach Pushed as commit 59019cf.

💡 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

Labels

integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

4 participants