-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
8327138: Clean up status management in cdsConfig.hpp and CDS.java #18095
8327138: Clean up status management in cdsConfig.hpp and CDS.java #18095
Conversation
👋 Welcome back iklam! A progress list of the required criteria for merging this PR into |
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.
Looks good. Just one nit below.
I assume that it has gone through some testing?
src/hotspot/share/cds/cdsConfig.hpp
Outdated
static void stop_dumping_full_module_graph(const char* reason = nullptr) NOT_CDS_JAVA_HEAP_RETURN; | ||
static bool is_dumping_full_module_graph() { return CDS_ONLY(_is_dumping_full_module_graph) NOT_CDS(false); } | ||
static void stop_using_full_module_graph(const char* reason = nullptr) NOT_CDS_JAVA_HEAP_RETURN; | ||
static bool is_using_full_module_graph() NOT_CDS_JAVA_HEAP_RETURN_(false); |
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.
Please align this with line #90.
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.
Do you mean aligning like this:
static bool is_dumping_heap() NOT_CDS_JAVA_HEAP_RETURN_(false);
static void stop_dumping_full_module_graph(const char* reason = nullptr) NOT_CDS_JAVA_HEAP_RETURN;
static bool is_dumping_full_module_graph() { return CDS_ONLY(_is_dumping_full_module_graph) NOT_CDS(false); }
static void stop_using_full_module_graph(const char* reason = nullptr) NOT_CDS_JAVA_HEAP_RETURN;
static bool is_using_full_module_graph() NOT_CDS_JAVA_HEAP_RETURN_(false);
I think this is more messy, and you can't easily tell that these four functions are all related to the same feature (full_module_graph).
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.
I meant the following. Just the last line #94 needs to be changed - shift one space to the left after bool
.
static bool is_dumping_heap() NOT_CDS_JAVA_HEAP_RETURN_(false);
static void stop_dumping_full_module_graph(const char* reason = nullptr) NOT_CDS_JAVA_HEAP_RETURN;
static bool is_dumping_full_module_graph() { return CDS_ONLY(_is_dumping_full_module_graph) NOT_CDS(false); }
static void stop_using_full_module_graph(const char* reason = nullptr) NOT_CDS_JAVA_HEAP_RETURN;
static bool is_using_full_module_graph() NOT_CDS_JAVA_HEAP_RETURN_(false);
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.
I wanted line 94 to align the "using_full_module_graph" part with the function at line 93.
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.
In that case, it looks good.
@iklam 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 no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
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, thanks! Just one comment on format below.
src/hotspot/share/cds/cdsConfig.hpp
Outdated
@@ -61,6 +69,7 @@ class CDSConfig : public AllStatic { | |||
static bool is_dumping_dynamic_archive() { return CDS_ONLY(_is_dumping_dynamic_archive) NOT_CDS(false); } | |||
static void enable_dumping_dynamic_archive() { CDS_ONLY(_is_dumping_dynamic_archive = true); } | |||
static void disable_dumping_dynamic_archive() { CDS_ONLY(_is_dumping_dynamic_archive = false); } | |||
static bool is_using_archive() NOT_CDS_RETURN_(false); |
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.
Could you fix the alignment of the method names here?
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.
Since several people are confused by the alignment style (align same words to the right), I fixed the grouping of the functions so that the text is aligned to the left, as in most header files.
Please take a look at ae0e0ac -- it's best viewed on GutHub with white spaces hidden.
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.
Some drive-by nits. (But copyright needs fixing.)
src/hotspot/share/cds/cdsConfig.cpp
Outdated
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. | ||
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. |
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.
Incorrect copyright update - should be "2023, 2024,"
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.
Fixed.
src/hotspot/share/cds/cdsConfig.cpp
Outdated
return (is_dumping_archive() ? IS_DUMPING_ARCHIVE : 0) | | ||
(is_dumping_static_archive() ? IS_DUMPING_STATIC_ARCHIVE : 0) | | ||
(is_logging_lambda_form_invokers() ? IS_LOGGING_LAMBDA_FORM_INVOKERS : 0) | | ||
(is_using_archive() ? IS_USING_ARCHIVE : 0); |
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 can remove one space before the ? in each line
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.
Fixed.
src/hotspot/share/cds/cdsConfig.hpp
Outdated
static const int IS_DUMPING_ARCHIVE = 1 << 0; | ||
static const int IS_DUMPING_STATIC_ARCHIVE = 1 << 1; | ||
static const int IS_LOGGING_LAMBDA_FORM_INVOKERS = 1 << 2; | ||
static const int IS_USING_ARCHIVE = 1 << 3; |
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.
why is the = sign so far away?
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.
Fixed.
Thanks @calvinccheung @matias9927 @dholmes-ora for the review. |
A few clean ups:
Rename functions like "
s_loading_full_module_graph()
tois_using_full_module_graph()
. The meaning of "loading" is not clear: it might be interpreted as to cover only the period where the artifact is being loaded, but not the period after the artifact is completely loaded. However, the function is meant to cover both periods, so "using" is a more precise term.The cumbersome sounding
disable_loading_full_module_graph()
is changed tostop_using_full_module_graph()
, etc.The status of
is_using_optimized_module_handling()
is moved from metaspaceShared.hpp to cdsConfig.hpp, to be consolidated with other types of CDS status.The status of CDS was communicated to the Java class
jdk.internal.misc.CDS
by ad-hoc native methods. This is now changed to a single method,CDS.getCDSConfigStatus()
that returns a bit field. That way we don't need to add a new native method for each type of status.CDS.isDumpingClassList()
was a misnomer. It's changed toCDS.isLoggingLambdaFormInvokers()
.Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/18095/head:pull/18095
$ git checkout pull/18095
Update a local copy of the PR:
$ git checkout pull/18095
$ git pull https://git.openjdk.org/jdk.git pull/18095/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 18095
View PR using the GUI difftool:
$ git pr show -t 18095
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/18095.diff
Webrev
Link to Webrev Comment