RFR: 8301992: Embed SymbolTable CHT node [v4]
Calvin Cheung
ccheung at openjdk.org
Thu Feb 16 23:12:24 UTC 2023
On Thu, 16 Feb 2023 19:52:31 GMT, Ioi Lam <iklam at openjdk.org> wrote:
>> How about performing the above check at the beginning of the function, right after the assert statement as follows?
>> Let me know if the added assert is necessary.
>>
>> --- a/src/hotspot/share/classfile/symbolTable.cpp
>> +++ b/src/hotspot/share/classfile/symbolTable.cpp
>> @@ -151,6 +151,13 @@ public:
>> // If #2, then the symbol is dead (refcount==0)
>> assert(value.is_permanent() || (value.refcount() == 1) || (value.refcount() == 0),
>> "refcount %d", value.refcount());
>> +#if INCLUDE_CDS
>> + if (DumpSharedSpaces) {
>> + assert(value.is_permanent(), "symbol should be permanent during CDS dumping");
>> + // no deallocation is needed
>> + return;
>> + }
>> +#endif
>> if (value.refcount() == 1) {
>> value.decrement_refcount();
>> assert(value.refcount() == 0, "expected dead symbol");
>
> Currently, in `allocate_node_impl()` there's no guarantee that the refcount is always permanent when DumpSharedSpaces is true.
>
> During CDS dumping, some classes may be loaded by non-boot loaders, and their symbols may initially have a non-permanent count. Eventually, we force all the archived symbols to be permanent, but theoretically calls to `free_node()` may happen before that.
Ok. I've pushed a commit without the assert statement.
-------------
PR: https://git.openjdk.org/jdk/pull/12562
More information about the hotspot-dev
mailing list