Skip to content

8388192: [lworld] Some code is not guarded by Arguments::is_valhalla_enabled() - #32123

Closed
TobiHartmann wants to merge 3 commits into
openjdk:masterfrom
TobiHartmann:8388192
Closed

8388192: [lworld] Some code is not guarded by Arguments::is_valhalla_enabled()#32123
TobiHartmann wants to merge 3 commits into
openjdk:masterfrom
TobiHartmann:8388192

Conversation

@TobiHartmann

@TobiHartmann TobiHartmann commented Jul 31, 2026

Copy link
Copy Markdown
Member

This PR replaces the Valhalla draft PR 2640, which was already reviewed by @chhagedorn but was not integrated due to the code freeze immediately before the Valhalla mainline integration.


Some Valhalla specific code misses an Arguments::is_valhalla_enabled() check.

Thanks,
Tobias



Progress

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

Issue

  • JDK-8388192: [lworld] Some code is not guarded by Arguments::is_valhalla_enabled() (Enhancement - P4)

Reviewers

Contributors

  • Fei Yang <fyang@openjdk.org>

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 32123

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/32123.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper

bridgekeeper Bot commented Jul 31, 2026

Copy link
Copy Markdown

👋 Welcome back thartmann! A progress list of the required criteria for merging this PR into master 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 Jul 31, 2026

Copy link
Copy Markdown

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

8388192: [lworld] Some code is not guarded by Arguments::is_valhalla_enabled()

Co-authored-by: Fei Yang <fyang@openjdk.org>
Reviewed-by: aboldtch, chagedorn, kvn

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 20 new commits pushed to the master 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 master branch, type /integrate in a new comment.

@openjdk openjdk Bot added the hotspot hotspot-dev@openjdk.org label Jul 31, 2026
@openjdk

openjdk Bot commented Jul 31, 2026

Copy link
Copy Markdown

@TobiHartmann The following label will be automatically applied to this pull request:

  • hotspot

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk

openjdk Bot commented Jul 31, 2026

Copy link
Copy Markdown

The total number of required reviews for this PR has been set to 2 based on the presence of this label: hotspot. This can be overridden with the /reviewers command.

@TobiHartmann
TobiHartmann marked this pull request as ready for review July 31, 2026 08:44
@openjdk openjdk Bot added the rfr Pull request is ready for review label Jul 31, 2026
@mlbridge

mlbridge Bot commented Jul 31, 2026

Copy link
Copy Markdown

Webrevs

@xmas92 xmas92 left a comment

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.

lgtm. Seems to be relying on some transitive includes, should IWYU and add #include "runtime/arguments.hpp" to the files which do not have it.

@TobiHartmann

Copy link
Copy Markdown
Member Author

Thanks Axel, good catch. I now also discovered the missing includes in the nopch build. Fixed!

@TobiHartmann

Copy link
Copy Markdown
Member Author

Thanks Axel!

@chhagedorn chhagedorn left a comment

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.

Still good!

@openjdk openjdk Bot added the ready Pull request is ready to be integrated label Jul 31, 2026
@TobiHartmann

Copy link
Copy Markdown
Member Author

Thanks Christian!

@RealFYang

Copy link
Copy Markdown
Member

Hi, I have just prepared a similar change for the riscv64 platform. @TobiHartmann : Do you mind having it in this PR? Thanks.

Verified with make test TEST="hotspot_valhalla jdk_valhalla valhalla_adopted" using fastdebug build on linux-riscv64.

riscv64-addon.diff.txt

@vnkozlov vnkozlov 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.

Good.

@vnkozlov

vnkozlov commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

@TobiHartmann do you have asserts in Valhalla methods to check if it is enabled? It may help to find other places when check is missing.

@vnkozlov

vnkozlov commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

This fix solved some AOT code caching failures I see after merge with Valhalla.

@TobiHartmann

Copy link
Copy Markdown
Member Author

Do you mind having it in this PR? Thanks.

@RealFYang Sure, I added it. Thanks!

@TobiHartmann

Copy link
Copy Markdown
Member Author

/contributor add @RealFYang

@openjdk openjdk Bot removed the ready Pull request is ready to be integrated label Aug 3, 2026
@openjdk

openjdk Bot commented Aug 3, 2026

Copy link
Copy Markdown

@TobiHartmann
Contributor Fei Yang <fyang@openjdk.org> successfully added.

@TobiHartmann

Copy link
Copy Markdown
Member Author

do you have asserts in Valhalla methods to check if it is enabled?

Good point. Most relevant methods either check directly:

bool ciInstanceKlass::can_be_inline_klass(bool is_exact) {
if (!Arguments::is_valhalla_enabled()) {
return false;

Or they assert on some specific flag for an optimization that is only enabled when Valhalla is enabled:

assert(InlineTypePassFieldsAsArgs || InlineTypeReturnedAsFields, "Not needed");

I think adding more asserts would still be useful, especially in the cases I fixed here. I filed JDK-8389595 to keep track of this.

@TobiHartmann

Copy link
Copy Markdown
Member Author

Thanks Christian! I'll integrate this to fix the failures that Vladimir mentioned.

@TobiHartmann

Copy link
Copy Markdown
Member Author

/integrate

@openjdk

openjdk Bot commented Aug 3, 2026

Copy link
Copy Markdown

@TobiHartmann This pull request has not yet been marked as ready for integration.

@openjdk openjdk Bot added the ready Pull request is ready to be integrated label Aug 3, 2026
@TobiHartmann

Copy link
Copy Markdown
Member Author

/integrate

@openjdk

openjdk Bot commented Aug 3, 2026

Copy link
Copy Markdown

Going to push as commit 185c99f.
Since your change was applied there have been 21 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

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

openjdk Bot commented Aug 3, 2026

Copy link
Copy Markdown

@TobiHartmann Pushed as commit 185c99f.

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

@vnkozlov

vnkozlov commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

I think adding more asserts would still be useful, especially in the cases I fixed here. I filed JDK-8389595 to keep track of this.

Thank you

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

Labels

hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

5 participants