-
Type:
Enhancement
-
Resolution: Unresolved
-
Priority:
P4
-
Affects Version/s: 26
-
Component/s: hotspot
-
In Review
Currently, in the intrinsic for Object::hashCode or System::identityHashCode, we perform a read of the mark word/object header. This load is not constant and cannot be eliminated. As a result, we cannot evaluate the identity hash code of a constant object as a constant value.
Evaluating the hash of a constant as a constant would be helpful for certain workloads: for example, if a call uses class literals to look up in a map, and the map supports constant folding, if the class hash becomes a constant, the whole map lookup can get eliminated.
We can easily add a shortcut to constant-fold a hash value for an object to provide such benefits.
Evaluating the hash of a constant as a constant would be helpful for certain workloads: for example, if a call uses class literals to look up in a map, and the map supports constant folding, if the class hash becomes a constant, the whole map lookup can get eliminated.
We can easily add a shortcut to constant-fold a hash value for an object to provide such benefits.
- links to
-
Review(master)
openjdk/jdk/28589