RFR: 8304069: ClassFileParser has ad-hoc hashtables

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


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

>> The ClassFileParser has ad-hoc hash tables for checking for duplicate names for fields, methods and interfaces. ResourceHashtable will now be used instead. Verified with tier1-4 tests.
>
> 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).

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

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


More information about the hotspot-runtime-dev mailing list