RFR: 8367981: Update CompactHashtable comments [v4]

Ioi Lam iklam at openjdk.org
Tue Sep 23 21:39:49 UTC 2025


On Tue, 23 Sep 2025 19:01:49 GMT, Hamlin Li <mli at openjdk.org> wrote:

>> Hi,
>> Can you help to review this patch?
>> 
>> The comments of CompactHashtable and related classes are out of date, and some comments are unclear, wrong or misleading.
>> As the related classes are used in more and more scenarios, it's helpful to update the comments.
>> 
>> Thanks
>
> Hamlin Li has updated the pull request incrementally with one additional commit since the last revision:
> 
>   rename

src/hotspot/share/classfile/compactHashtable.hpp line 98:

> 96: 
> 97:     u4 value() {
> 98:       return _encoded_value;

The accessor should also be renamed to `encoded_value()`. There are also comments like `(hash, value)` that should also be renamed,

src/hotspot/share/classfile/compactHashtable.hpp line 197:

> 195: //   - The 0-th bucket is a REGULAR_BUCKET_TYPE with two entries
> 196: //   - The 1-st bucket is a VALUE_ONLY_BUCKET_TYPE with one entry.
> 197: //   - The 2-th bucket is a REGULAR_BUCKET_TYPE with zeo entries.

Sorry I had some typos in my original suggestion. Here's the fixed version. I think this will be easier to read:

Suggestion:

//   - Bucket #0 is a REGULAR_BUCKET_TYPE with two entries
//   - Bucket #1 is a VALUE_ONLY_BUCKET_TYPE with one entry.
//   - Bucket #2 is a REGULAR_BUCKET_TYPE with zero entries.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27360#discussion_r2373513100
PR Review Comment: https://git.openjdk.org/jdk/pull/27360#discussion_r2373512782


More information about the hotspot-runtime-dev mailing list