hash value in java objects

Vitaly Davidovich vitalyd at gmail.com
Fri Dec 7 14:31:26 PST 2012

Hash is encoded in the mark word, so I think the answer to your question is
it's created when object is allocated (and thus gets a markOop).  The
actual hash value is decoded from the mark word at call time, but it's just
a shift and mask at that point.  Someone can correct me if this is wrong.


Sent from my phone
On Dec 7, 2012 4:52 PM, "Xin Tong" <xerox.time.tech at gmail.com> wrote:

> I am wondering when the hash values in the java objects are
> materialized. are they materialized when the object is created ? or
> when hashCode on the object is called.  what about modifications to
> the object ?
> Xin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20121207/4337297f/attachment.html 

More information about the hotspot-compiler-dev mailing list