Subject text

Tom Rodriguez tom.rodriguez at
Fri Mar 25 13:38:03 PDT 2011

6378256: Performance problem with System.identityHashCode in client compiler

The hashCode for an object can often be grabbed directly from the
header instead of going into the runtime and C1 has an existing
optimization for Object.hashCode.  System.identityHashCode is the same
as calling Object.hashCode directly and should have the same
optimization.  The fix is to use the same trick for identityHashCode
as is being used for Object.hashCode with the addition of a null
check.  Doing this is 10 times faster.  Tested with test case from
report.  I also added an implementation for x86_64 which is just a
straight copy of the x86_32 code.  I put it under !TIERED since in the
tiered world the extra code just makes the C2 version slightly slower.

As an aside, C2 implements Object.hashCode using a vtable check to deal
with the potential overloading.

-------------- next part --------------
An HTML attachment was scrubbed...

More information about the hotspot-compiler-dev mailing list