tom.rodriguez at oracle.com
Fri Mar 25 13:39:08 PDT 2011
Accidentally pushed send too early. Ignore for now.
On Mar 25, 2011, at 1:38 PM, Tom Rodriguez wrote:
> 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.
More information about the hotspot-compiler-dev