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
8251261: CDS dumping should not clear states in live classes #227
8251261: CDS dumping should not clear states in live classes #227
Conversation
|
@iklam The following label 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 list. If you would like to change these labels, use the |
/label add hotspot-runtime |
@iklam |
@iklam |
Webrevs
|
@iklam This change now passes all automated pre-integration checks. 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 14 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.
|
@@ -398,8 +398,6 @@ void KlassSubGraphInfo::add_subgraph_object_klass(Klass* orig_k, Klass *relocate | |||
new(ResourceObj::C_HEAP, mtClass) GrowableArray<Klass*>(50, mtClass); | |||
} | |||
|
|||
assert(relocated_k->is_shared(), "must be a shared class"); |
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 this assert 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.
The delete is reasonable since line 293 already assert that relocated_k is a relocated klass in shared region which must be shared class I think.
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.
Klass::set_is_shared()
is called in Klass::remove_unshareable_info()
. This PR has moved the calls to remove_unshareable_info()
to a later stage. So when this assert is executed, relocated_k->is_shared()
is false.
In the new commit 03f7485 I've restored the assert and changed it to the following:
assert(ArchiveBuilder::singleton()->is_in_buffer_space(relocated_k), "must be a shared class");
/integrate |
@iklam Since your change was applied there have been 14 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 8b85c3a. |
We had an issue when CDS dumped a static archive (java -Xshare:dump), it would call
Klass::remove_unshareable_info()
too early. In one of the test failures, ZGC was still scanning the heap and stepped on a class whose mirror has been removed.The fix is to avoid modifying the states of the Java classes during -Xshare:dump. Instead, we call
Klass::remove_unshareable_info()
only on the copy of the classes which are written into the archive. It's safe to do so because these copies are visible only to the CDS dumping code. They aren't accessible by the GC or any other subsystems.It turns out that we were already doing this for the dynamic archive. So I just generalized the code in dynamicArchive.cpp and moved it to archiveBuilder.cpp. So this PR is one step forward for JDK-8234693 Consolidate CDS static and dynamic archive dumping code.
I also fixed another case where we modify the global VM state -- I removed
Universe::clear_basic_type_mirrors()
.We are still modifying some global VM states (such as SystemDictionary::_well_known_klasses). They seem harmless now, but we might have to do more fixes in the future.
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/227/head:pull/227
$ git checkout pull/227