RFR: 8372845: Fold identity hash code if object is constant
Vladimir Ivanov
vlivanov at openjdk.org
Tue Dec 2 20:56:18 UTC 2025
On Tue, 2 Dec 2025 20:36:50 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:
> I'm not sure it makes sense to support Object::hashCode unless C2 can eliminate generate_virtual_guard for a constant receiver. I'd just limit constant folding to !is_virtual case for now.
Or, alternatively, inspect constant object's v-table during compilation and ensure that corresponding slot points at `Object::hashCode`.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28589#issuecomment-3603919570
More information about the hotspot-runtime-dev
mailing list