RFR: 8301992: Embed SymbolTable CHT node [v3]

Ioi Lam iklam at openjdk.org
Wed Feb 15 23:40:31 UTC 2023


On Wed, 15 Feb 2023 20:30:30 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:

>> Please review this patch for embedding the Symbol inside a ConcurrentHashTable Node instead of having a pointer to a Symbol. This eliminates malloc/free for each Symbol.
>> 
>> This patch is co-authored by @robehn.
>> 
>> Passed tiers 1 - 4 testing.
>
> Calvin Cheung has updated the pull request incrementally with one additional commit since the last revision:
> 
>   remove unused allocate_symbol() declaration in symbolTable.hpp

src/hotspot/share/classfile/symbolTable.cpp line 161:

> 159:       FreeHeap(memory);
> 160:       SymbolTable::item_removed();
> 161:     }

We don’t call afree() anymore if the symbol is permanent. . Is this intentional?

Actually the old code has a bug. A non permanent symbol allocated from the c heap can overflow the refcount and become permanent. If it needs to be freed, we cannot call afree.

Anyway, how is it possible for a permanent symbol to be freed here? Maybe this should be changed to an assert?

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

PR: https://git.openjdk.org/jdk/pull/12562


More information about the hotspot-dev mailing list