-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8320826: call allocate_shared_strings_array after all strings are interned #16839
8320826: call allocate_shared_strings_array after all strings are interned #16839
Conversation
👋 Welcome back iklam! A progress list of the required criteria for merging this PR into |
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
@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 83 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 |
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! I just have one concern below:
@@ -806,7 +806,9 @@ oop StringTable::lookup_shared(const jchar* name, int len) { | |||
// This should be called when we know no more strings will be added (which will be easy | |||
// to guarantee because CDS runs with a single Java thread. See JDK-8253495.) | |||
void StringTable::allocate_shared_strings_array(TRAPS) { | |||
assert(CDSConfig::is_dumping_heap(), "must be"); | |||
if (!CDSConfig::is_dumping_heap()) { |
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 seems to be redundant considering that allocate_shared_strings_array()
is only called by preload_and_dump_impl
. Unless you expect this method to be called elsewhere eventually?
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.
At the point where preload_and_dump_impl() calls allocate_shared_strings_array(), heap dumping may have been disabled. So this check avoids doing unnecessary work for that situation.
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 clarification, approved
Thanks @calvinccheung and @matias9927 for the review. |
Going to push as commit 630bafd.
Your commit was automatically rebased without conflicts. |
StringTable::allocate_shared_strings_array()
creates a Java object array that has the exact same size as the number of currently interned strings. Therefore, we need to move it to just before we enter the safepoint, where we know no more Java code would be execute.I also had to change the assert in
StringTable::allocate_shared_strings_array()
to a condition check: it's possible forHeapShared::init_for_dumping()
to disable heap dumping when a Java agent transforms classes like jdk.internal.math.FDBigInteger.Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/16839/head:pull/16839
$ git checkout pull/16839
Update a local copy of the PR:
$ git checkout pull/16839
$ git pull https://git.openjdk.org/jdk.git pull/16839/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 16839
View PR using the GUI difftool:
$ git pr show -t 16839
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/16839.diff
Webrev
Link to Webrev Comment