-
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
8320935: Move CDS config initialization code to cdsConfig.cpp #16868
8320935: Move CDS config initialization code to cdsConfig.cpp #16868
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.
Code migration from arguments cpp to cdsConfig.cpp looks good.
Found a minor simplification regarding the include statements.
#include "logging/log.hpp" | ||
#include "runtime/arguments.hpp" | ||
#include "runtime/java.hpp" |
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 was able to build with your patch without including java.hpp
.
The #include java.hpp could also be removed from arguments.cpp.
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.
cdsConfig.cpp needs the declaration of vm_exit_during_initialization()
from java.hpp. Although java.hpp is included by arguments.hpp, we usually try to avoid such indirectly inclusions. Otherwise if arguments.hpp is changed to no longer include java.hpp, then cdsConfig.hpp will fail to compile.
I am not sure about arguments.cpp -- if java.hpp is already included by arguments.hpp, do we need to explicitly include it in arguments.cpp? I'll leave that alone in this PR.
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 the explanation. Looks good 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.
This looks good! I think this is a good opportunity to refactor some of the code for better readability so I left some comments below.
log_info(cds)("full module graph: disabled due to incompatible property: %s=%s", key, value); | ||
} | ||
#endif | ||
CDSConfig::check_system_property(key, value); |
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 see this is only called once, do you expect this method to be used again? It may be unnecessary to extract this code into its own method.
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 to move the code from arguments.cpp to cdsConfig.cpp, so I had to put it in a new function.
src/hotspot/share/cds/cdsConfig.cpp
Outdated
|
||
void CDSConfig::extract_shared_archive_paths(const char* archive_path, | ||
char** base_archive_path, | ||
char** top_archive_path) { |
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 align these arguments?
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.
*top_archive_path = cur_path; | ||
} | ||
|
||
void CDSConfig::init_shared_archive_paths() { |
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 I see this there is a lot of indentation thanks to the nested conditionals. I don't have much to offer but is there a cleaner way to format this method? Maybe you can extract the code in if (archives == 1)
into its own method for better readability.
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 want to keep the code change minimal while moving code from one file to another. I'll refactor this function in a follow-on PR. That way it will be easier to track the code history.
@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 1 new commit pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and 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. Did not find any functional difference to the original code.
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 addressing my comments. Approved!
Thanks @calvinccheung @matias9927 @tstuefe for the review. |
Going to push as commit 4c96aac.
Your commit was automatically rebased without conflicts. |
This is a simple clean up that moves the code for initializing the CDS config states from arguments.cpp to cdsConfig.cpp
I renamed a few functions, but otherwise the code is unchanged.
get_default_shared_archive_path()
->default_archive_path()
GetSharedArchivePath()
->static_archive_path()
GetSharedDynamicArchivePath()
->dynamic_archive_path()
There's also less
#if INCLUDE_CDS
since the entire cdsConfig.cpp file is compiled only if CDS is enabled.Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/16868/head:pull/16868
$ git checkout pull/16868
Update a local copy of the PR:
$ git checkout pull/16868
$ git pull https://git.openjdk.org/jdk.git pull/16868/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 16868
View PR using the GUI difftool:
$ git pr show -t 16868
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/16868.diff
Webrev
Link to Webrev Comment