RFR: 8301992: Embed SymbolTable CHT node
Coleen Phillimore
coleenp at openjdk.org
Wed Feb 15 13:43:47 UTC 2023
On Wed, 15 Feb 2023 03:35:50 GMT, Ioi Lam <iklam at openjdk.org> wrote:
>> 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.
If the symbol is permanent, it's allocated to an arena not C heap but I agree that the variable name should be changed.
-------------
PR: https://git.openjdk.org/jdk/pull/12562
More information about the hotspot-dev
mailing list