RFR: 8304069: ClassFileParser has ad-hoc hashtables

Coleen Phillimore coleenp at openjdk.org
Wed Mar 22 18:05:27 UTC 2023


On Wed, 22 Mar 2023 17:56:55 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> src/hotspot/share/classfile/classFileParser.cpp line 782:
>> 
>>> 780:     raw_hash += ((unsigned int)(uintptr_t)namesig->_sig) >> LogHeapWordSize;
>>> 781: 
>>> 782:     return (raw_hash + (unsigned int)(uintptr_t)namesig->_name) % HASH_ROW_SIZE;
>> 
>> I don't know if you need to use % since that's what the hashtable will do to find the bucket.
>
> You could also make the hash function be name->identity_hash() (ignoring the nullptr for sig).

Lastly, I think you need a constructor to null out the _sig field for the place where that's null.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13141#discussion_r1145214126


More information about the hotspot-runtime-dev mailing list