RFR: 8301992: Embed SymbolTable CHT node

Ioi Lam iklam at openjdk.org
Wed Feb 15 03:38:42 UTC 2023


On Wed, 15 Feb 2023 00:50:31 GMT, Coleen Phillimore <coleenp 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.
>
> src/hotspot/share/classfile/symbolTable.cpp line 469:
> 
>> 467:   const int alloc_size = Symbol::byte_size(len);
>> 468:   u1* u1_buf = NEW_RESOURCE_ARRAY(u1, alloc_size);
>> 469:   Symbol* tmp = ::new ((void*)u1_buf) Symbol((const u1*)name, len, (heap && !DumpSharedSpaces) ? 1 : PERM_REFCOUNT);
> 
> There's a version of NEW_RESOURCE_ARRAY that takes the Thread argument, so it doesn't have to call Thread::current()

The name of the `heap` parameter to this function should be changed. The node, which contains the Symbol, is always C_HEAP allocated. I would suggest renaming it to `is_permanent`. Same for the other functions that have a `heap` parameter.

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

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


More information about the hotspot-dev mailing list