RFR: 8372845: C2: Fold identity hash code if object is constant [v4]
Quan Anh Mai
qamai at openjdk.org
Tue Jan 13 03:31:36 UTC 2026
On Tue, 13 Jan 2026 03:16:44 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:
>> Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 12 additional commits since the last revision:
>>
>> - Move test, fix merge garbage
>> - Merge branch 'master' of https://github.com/openjdk/jdk into fix/identity-hash-const
>> - Merge branch 'master' of https://github.com/openjdk/jdk into fix/identity-hash-const
>> - Typo
>> - assert
>> - refactorings
>> - Typo
>> - Merge branch 'master' of https://github.com/openjdk/jdk into fix/identity-hash-const
>> - Cleanup
>> - identity hash support in C2
>> - ... and 2 more: https://git.openjdk.org/jdk/compare/91227712...67a3954f
>
> src/hotspot/share/ci/ciObject.hpp line 76:
>
>> 74: };
>> 75:
>> 76: const int IDENTITY_HASH_OFFSET = -1;
>
> `const` is fine, but `constexpr` is often preferred. Also, is `static` needed here? Another nitpick is that constants are usually not in uppercase in C++, as macros are often in uppercase.
It is also useful to note what this value is. It is not clear at first glance why offset is -1 here.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28589#discussion_r2684658970
More information about the hotspot-runtime-dev
mailing list