RFR: 8372845: C2: Fold identity hash code if object is constant [v4]
Chen Liang
liach at openjdk.org
Tue Dec 16 02:42:59 UTC 2025
On Tue, 16 Dec 2025 02:29:05 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/cea24102...67a3954f
>
> src/hotspot/share/opto/library_call.cpp line 4806:
>
>> 4804: assert(!is_virtual, "no devirtualization for constant receiver?");
>> 4805: ciConstant identity_hash = t->const_oop()->identity_hash();
>> 4806: if (identity_hash.is_valid()) {
>
> Is there any reason we don't calculate the identity hash right away if there is not any?
@iwanowww recommended not to so that we can save resources - ideally we should convert this to sort of macro node, so we can calculate the hash if the node is not eliminated in the end.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28589#discussion_r2621544616
More information about the hotspot-dev
mailing list