RFR: 8372845: C2: Fold identity hash code if object is constant [v3]
John R Rose
jrose at openjdk.org
Sat Dec 13 02:13:52 UTC 2025
On Tue, 2 Dec 2025 23:25:29 GMT, Chen Liang <liach at openjdk.org> wrote:
>> Folding identity hash as constant if the incoming argument is constant would be useful for quick map lookups, such as for the [Classifier proposal](https://openjdk.org/jeps/8357674). Currently, identity hash is not constant because it loads the object header/mark word. We can add an explicit bypass to load an existing hash eagerly instead.
>
> Chen Liang has updated the pull request incrementally with one additional commit since the last revision:
>
> Typo
src/hotspot/share/opto/library_call.cpp line 4786:
> 4784: if (t != nullptr && t->const_oop() != nullptr) {
> 4785: jint hash = t->const_oop()->identity_hash_or_no_hash();
> 4786: if (hash != 0) {
Don’t compare against zero, please, but against no_hash. (Any other stray zeroes?)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28589#discussion_r2615991597
More information about the hotspot-dev
mailing list