RFR: 8251261: CDS dumping should not clear states in live classes [v2]

Ioi Lam iklam at openjdk.java.net
Tue Sep 22 03:04:06 UTC 2020


On Tue, 22 Sep 2020 02:43:52 GMT, Yumin Qi <minqi at openjdk.org> wrote:

>> src/hotspot/share/memory/heapShared.cpp line 401:
>> 
>>> 399:   }
>>> 400:
>>> 401:   assert(relocated_k->is_shared(), "must be a shared class");
>> 
>> Why is this assert removed?
>
> 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.

`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](https://github.com/openjdk/jdk/pull/227/commits/03f748555f304d4cc4d180ab989617bcebe508fb)
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");

-------------

PR: https://git.openjdk.java.net/jdk/pull/227


More information about the hotspot-runtime-dev mailing list