hKash value in java objects
john.r.rose at oracle.com
Fri Dec 7 23:19:57 PST 2012
On Dec 7, 2012, at 9:39 PM, Xin Tong wrote:
> On Fri, Dec 7, 2012 at 11:38 PM, Krystal Mok <rednaxelafx at gmail.com> wrote:
>> Short answer is the identity hash code is calculated when:
>> 1. the hashCode() method is called the first time for this object, if
>> the type of this object doesn't override Object.hashCode();
>> 2. System.identityHashCode() is called the first time for this object.
> would not materialize the hashcode takes much code. why not materialize lazily ?
That's what Kris means, I think.
You can check the code; it's ObjectSynchronizer::FastHashCode in this file:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the hotspot-compiler-dev