RFR: 8372845: C2: Fold identity hash code if object is constant [v6]
Emanuel Peter
epeter at openjdk.org
Tue Jan 27 06:55:16 UTC 2026
On Mon, 26 Jan 2026 19:37:06 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:
>
> Use UpperCamelCase
test/hotspot/jtreg/compiler/intrinsics/object/IdentityHashCodeFold.java line 37:
> 35: * @summary Verify constant folding is possible for identity hash code
> 36: * @library /test/lib /
> 37: * @requires vm.compiler2.enabled
Drive-by comment:
Do you really need this restriction? IR rules are only executed if C2 is available anyway.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28589#discussion_r2730518926
More information about the hotspot-runtime-dev
mailing list