Skip to content

8379501: [lworld] Clean up Valhalla flags#2226

Closed
Arraying wants to merge 19 commits intoopenjdk:lworldfrom
Arraying:JDK-8379501
Closed

8379501: [lworld] Clean up Valhalla flags#2226
Arraying wants to merge 19 commits intoopenjdk:lworldfrom
Arraying:JDK-8379501

Conversation

@Arraying
Copy link
Copy Markdown
Member

@Arraying Arraying commented Mar 13, 2026

Hi all,

This PR cleans up Valhalla flags. To summarize (for the exhaustive changes, please refer to the diff):

  • Many flags have their level bumped down. No product flags remain in Valhalla.
  • The granular flattening control flags have received consistent names.
  • Some granular flattening control flags have been experimentalized.
  • Setting granular flattening control flags will give a VM warning is flattening is not enabled.
  • Flat array printing has been debugized.
  • Descriptions are updated.
  • Updated all tests to use the new flags.

Testing: tiers 1-3.


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-8379501: [lworld] Clean up Valhalla flags (Enhancement - P3)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2226

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper bot commented Mar 13, 2026

👋 Welcome back phubner! 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 13, 2026

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

8379501: [lworld] Clean up Valhalla flags

Reviewed-by: fparain, mchevalier

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 108 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 8379501 8379501: [lworld] Clean up Valhalla flags Mar 13, 2026
@Arraying Arraying marked this pull request as ready for review March 13, 2026 16:28
@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 13, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge bot commented Mar 13, 2026

Webrevs

Copy link
Copy Markdown
Member

@stefank stefank left a comment

Choose a reason for hiding this comment

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

Thank you! The less usage of the word "inline" to describe values, the better IMO. I've skimmed through the patch and I think it looks good. I've added a couple of nits that you might want to consider.

Comment thread src/hotspot/share/opto/parse2.cpp Outdated
Comment on lines 3883 to +3884
if (!FLAG_IS_DEFAULT(flag)) { \
warning("Valhalla-specific flag \"%s\" has no effect when --enable-preview is not specified.", #flag); \
warning("Preview-specific flag \"%s\" has no effect when --enable-preview is not specified.", #flag); \
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.

Is this done because we don't want to mention Valhalla to the users?

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.

It's less that we want to explicitly hide Valhalla, it's more that we've transitioned from Valhalla vs non-Valhalla to preview vs non-preview, so our warnings should reflect that as well.

Comment thread src/hotspot/share/runtime/arguments.cpp Outdated
@@ -38,106 +38,113 @@ public class InlineTypes {
"--add-exports", "java.base/jdk.internal.value=ALL-UNNAMED",
"--add-exports", "java.base/jdk.internal.vm.annotation=ALL-UNNAMED",
"--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED",
"-XX:+UnlockDiagnosticVMOptions",
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.

Unrelated to this PR, but I saw this flag:
"-XX:+IgnoreUnrecognizedVMOptions",

I would consider removing from all the tests as a follow-up PR. We've been bitten by that flag so many times in our testing that we shouldn't use it at all, unless there's a written motivation why it is needed. My 2c.

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.

Fair point, seems like a very slippery slope indeed. I've filed JDK-8380140 for compiler since they're the only ones who use the flag in Valhalla. Let's have them take a look and make an informed decision.

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.

We could probably remove the from this test because all the Flattening flags are diagnostic and available in product mode. We've added -XX:+IgnoreUnrecognizedVMOptions for tests that pass develop options. I suppose if the test is trying to test the develop option there's probably a @requires vm.debug that should be on these tests instead.
This could remove these I think and leave the others for another day.

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.

Are there Experimental options, requiring adding UnlockExperimentalVMOptions ?

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.

This PR already has a large and invasive scope, I am not super comfortable changing anything that's not strictly necessary. Yes, there is lot's of cleanup that can be done (and flag duplication in some tests), but I would prefer to keep this focused on what's needed for the CSR.

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 options listed in this scenario (and other scenarios) do not require experimental VM options. Only null-free flattening is experimental, the rest is diagnostic.

Arraying and others added 2 commits March 16, 2026 10:56
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 16, 2026
@Arraying Arraying marked this pull request as draft March 18, 2026 17:20
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Mar 18, 2026
@Arraying
Copy link
Copy Markdown
Member Author

Based on several rounds of offline feedback, I've updated this PR to get rid of the inline renames and changed the scope of this PR to the bare minimum. Further work needs to be done to make the names consistent.

@Arraying Arraying marked this pull request as ready for review March 20, 2026 08:57
@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 20, 2026
@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 20, 2026
Copy link
Copy Markdown
Member

@stefank stefank left a comment

Choose a reason for hiding this comment

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

Removing earlier approval to let others review this properly.

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Mar 20, 2026
Comment thread src/hotspot/share/runtime/globals.hpp 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.

LGTM

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 24, 2026
Copy link
Copy Markdown
Member

@marc-chevalier marc-chevalier left a comment

Choose a reason for hiding this comment

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

Looks fine to me. Thanks.

Copy link
Copy Markdown
Contributor

@coleenp coleenp left a comment

Choose a reason for hiding this comment

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

I have a couple of questions about the whole change. Thanks for making the options diagnostic.

@@ -38,106 +38,113 @@ public class InlineTypes {
"--add-exports", "java.base/jdk.internal.value=ALL-UNNAMED",
"--add-exports", "java.base/jdk.internal.vm.annotation=ALL-UNNAMED",
"--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED",
"-XX:+UnlockDiagnosticVMOptions",
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.

We could probably remove the from this test because all the Flattening flags are diagnostic and available in product mode. We've added -XX:+IgnoreUnrecognizedVMOptions for tests that pass develop options. I suppose if the test is trying to test the develop option there's probably a @requires vm.debug that should be on these tests instead.
This could remove these I think and leave the others for another day.

@@ -38,106 +38,113 @@ public class InlineTypes {
"--add-exports", "java.base/jdk.internal.value=ALL-UNNAMED",
"--add-exports", "java.base/jdk.internal.vm.annotation=ALL-UNNAMED",
"--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED",
"-XX:+UnlockDiagnosticVMOptions",
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.

Are there Experimental options, requiring adding UnlockExperimentalVMOptions ?

Copy link
Copy Markdown
Member

@marc-chevalier marc-chevalier left a comment

Choose a reason for hiding this comment

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

Still looks good to me. If tests are happy, it's fine! Also, if we find later that some unlock flag is missing in some weird test at some weird tier, it will not be a big disruption, and an easy fix. No need to be too scared.

@Arraying
Copy link
Copy Markdown
Member Author

Thanks for the reviews everybody.
/integrate

@openjdk
Copy link
Copy Markdown

openjdk bot commented Mar 27, 2026

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

openjdk bot commented Mar 27, 2026

@Arraying Pushed as commit 559e0e4.

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

5 participants