-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8236736: Change notproduct JVM flags to develop flags #18541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
👋 Welcome back coleenp! A progress list of the required criteria for merging this PR into |
|
@coleenp 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: 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 39 new commits pushed to the
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 |
|
@coleenp The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
For the past 15 years, "notproduct" flags haven't been working as they claim to be in globals.hpp. That doesn't seem to have bothered anyone. This definitely looks like a design that no one needs and should be removed for simplcity.
There are some references to "notproduct" in test/hotspot/jtreg/runtime/CommandLine that need to be removed.
|
Thank you for pointing out that I missed cleaning up the tests. One failed but I didn't see it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
|
||
| static void apply_debugger_ergo() { | ||
| #ifndef PRODUCT | ||
| // UseDebuggerErgo is notproduct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that the flag has been changed to a develop flag, it seems wrong that these are guarded by "#ifndef PRODUCT". Shouldn't this be changed to check for ASSERT instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, ifdef ASSERT is more appropriate.
| DIAGNOSTIC_FLAG_BUT_LOCKED, | ||
| EXPERIMENTAL_FLAG_BUT_LOCKED, | ||
| DEVELOPER_FLAG_BUT_PRODUCT_BUILD, | ||
| NOTPRODUCT_FLAG_BUT_PRODUCT_BUILD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the ',' on the previous line be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I guess our compilers don't complain about that anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking through the changes, Stefan.
|
|
||
| static void apply_debugger_ergo() { | ||
| #ifndef PRODUCT | ||
| // UseDebuggerErgo is notproduct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, ifdef ASSERT is more appropriate.
| DIAGNOSTIC_FLAG_BUT_LOCKED, | ||
| EXPERIMENTAL_FLAG_BUT_LOCKED, | ||
| DEVELOPER_FLAG_BUT_PRODUCT_BUILD, | ||
| NOTPRODUCT_FLAG_BUT_PRODUCT_BUILD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I guess our compilers don't complain about that anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you finally decided to take on JDK-8183288
Essentially you are removing "optimized" VM build with these changes. In this case you need to change make files.
All Statistics flags should be product (which will increase product VM size) - it is important. May be need build's variable --enable-jvm-feature-statistcs to include statistics code on demand.
|
The optimized build still works as before (actually surprised it still builds). Since for a long time the notproduct options acted like develop options, they still do just the same for the optimized build. For optimized, all the develop and notproduct options are materialized. Now just develop, not distinguishing notproduct from that. The same code enabled in PRODUCT is still enabled. I haven't looked at that removing optimized bug in a while. |
Okay, I see what you did here. You touched only flags declaration and did not So we still need to be careful when we use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good.
|
Yes, I had to remember what optimized did. It gets all the options, but builds with optimization and doesn't turn on asserts. I only removed the notproduct flag distinction since it hasn't been distinct for years and it's confusing what we actually wanted it to do. There was some printing code that we used to not materialize in PRODUCT, that eventually a lot of it was then changed to be materialized with PRODUCT builds. But still if you want to only include some printing in non PRODUCT builds, you have to use the #ifndef PRODUCT, and the flag around it either can be inside the not PRODUCT or will just do nothing. I'm going to add more: When I tried to make notproduct not materialize the option in PRODUCT, there were many compiler flags that failed (ie tested in product), like PrintOpto, PrintOptoInlining, OptoBreakpointOSR .. and some more. |
|
Long ago, before JDK-8024545 we did not have not_product flags declared in product build. Only debug flags were declared as constant. We relied on that change since then. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. One minor nit.
Also, it seems that develop and nonproduct (before this change) flags have
associated JVMFlag objects even in product builds. (The function
JVMFlag::is_constant_in_binary is evidence for this. I didn't dig through all
the code to verify it.) Probably if one were going to retain nonproduct
options and make them work "properly", they would only have JVMFlag objects in
non-product builds. But it's not obvious to me why we would want such objects
for either category in product builds. I think any change along that line
should be a separate followup.
| output = new OutputAnalyzer(pb.start()); | ||
| output.shouldNotHaveExitValue(0); | ||
| output.shouldContain("Error: VM option 'CheckCompressedOops' is notproduct and is available only in debug version of VM."); | ||
| output.shouldContain("Error: VM option 'CheckCompressedOops' is develop and is available only in debug version of VM."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like we don't need this test of the develop option CheckCompressedOops at all, since we have
the immediately preceding test of the develop option VerifyStack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, we've already tested this.
|
Thanks for reviewing, Kim. Is your suggestion to not have a JVMFlag object for develop flags in PRODUCT builds? Presumably to save some footprint? I'm not sure we would win fighting the macros to accomplish this. |
Yes, that's the suggestion and the rationale for it. It should also remove the need for is_constant_in_binary. I don't |
Currently the VM prints an error message for non-product flags, so we need to keep some information about them. We can probably skip the type information, etc, to save a little space, but the space saving would be minimal. |
|
Thanks for the reviews, Ioi, Vladimir, Kim and Stefan. |
|
Going to push as commit bea493b.
Your commit was automatically rebased without conflicts. |
Remove the notproduct distinction for command line options, rather than trying to wrestle the macros to fix the bug that they've been treated as develop options for some time now. This simplifies the command line option macros.
Tested with tier1-4, tier1 on Oracle platforms. Also built shenandoah.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/18541/head:pull/18541$ git checkout pull/18541Update a local copy of the PR:
$ git checkout pull/18541$ git pull https://git.openjdk.org/jdk.git pull/18541/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 18541View PR using the GUI difftool:
$ git pr show -t 18541Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/18541.diff
Webrev
Link to Webrev Comment