RFR: 8372845: Fold identity hash code if object is constant

Vladimir Kozlov kvn at openjdk.org
Tue Dec 2 21:00:58 UTC 2025


On Mon, 1 Dec 2025 23:01:08 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.

Good. Yes, we can work on constant folding in IGVN later.

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

Marked as reviewed by kvn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/28589#pullrequestreview-3532076661


More information about the hotspot-runtime-dev mailing list