Skip to content

8378519: [lworld] Fold fieldDescriptor / ResolvedFieldEntry checks into the FlatFieldPayload constructor#2186

Closed
xmas92 wants to merge 3 commits intoopenjdk:lworldfrom
xmas92:JDK-8378519
Closed

8378519: [lworld] Fold fieldDescriptor / ResolvedFieldEntry checks into the FlatFieldPayload constructor#2186
xmas92 wants to merge 3 commits intoopenjdk:lworldfrom
xmas92:JDK-8378519

Conversation

@xmas92
Copy link
Copy Markdown
Member

@xmas92 xmas92 commented Mar 2, 2026

Right now some of the call sites assets that ResolvedFieldEntry corresponds to the correct fieldDescriptor, and that these fields are in fact flattened. It was suggested that this would be more robust if this was folded into the construction of the FlatFieldPayload construction.

I moved these asserts up the construction hierarchy so that we also verify the unsafe flat field access. Because these can access nested flat values, some extra utility was added to find nested flat fields from an offset.

After this change the FlatFieldPayload check that the fieldDescriptor* constructor and the ResolvedFieldEntry* is a valid non-nested flat field in the containing object.

And the FlatValuePayload::construct_from_parts verifies that there is an field at that offset of of the correct InlineKlass. (Either a direct field or array element, or a nested flat field inside an flat field or array element)

Also the unsafe access logging was missing a ResourceMark, and changed it so it does not assert on bad offset, as I moved the assertions into the FlatValuePayload construction.

Testing:

  • Running tier 1 - 4 with --enable-preview
  • Running all Valhalla tests

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-8378519: [lworld] Fold fieldDescriptor / ResolvedFieldEntry checks into the FlatFieldPayload constructor (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2186

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented Mar 2, 2026

👋 Welcome back aboldtch! 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 Mar 2, 2026

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

8378519: [lworld] Fold fieldDescriptor / ResolvedFieldEntry checks into the FlatFieldPayload constructor

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 125 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 added the rfr Pull request is ready for review label Mar 2, 2026
@xmas92 xmas92 changed the title 8378519: [lworld] Fold fieldDescriptor / ResolvedFieldEntry checks in to the FlatFieldPayload constructor 8378519: [lworld] Fold fieldDescriptor / ResolvedFieldEntry checks into the FlatFieldPayload constructor Mar 2, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge Bot commented Mar 2, 2026

Webrevs

Comment thread src/hotspot/share/oops/instanceKlass.cpp Outdated
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.

@openjdk openjdk Bot added the ready Pull request is ready to be integrated label Mar 5, 2026
@xmas92
Copy link
Copy Markdown
Member Author

xmas92 commented Mar 10, 2026

Thanks for the review. Re-ran tests with the latests lworld merged.
/integrate

@openjdk
Copy link
Copy Markdown

openjdk Bot commented Mar 10, 2026

Going to push as commit f9799f4.
Since your change was applied there have been 230 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 Mar 10, 2026
@openjdk openjdk Bot closed this Mar 10, 2026
@openjdk openjdk Bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Mar 10, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented Mar 10, 2026

@xmas92 Pushed as commit f9799f4.

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

2 participants