RFR (XS) CR 8058643: (str) Re-examine hashCode implementation

Aleksey Shipilev aleksey.shipilev at oracle.com
Thu Sep 25 10:18:39 UTC 2014

On 09/25/2014 11:40 AM, Aleksey Shipilev wrote:
>> This is for HotSpot compiler guys to answer. Theoretically I think it is
>> possible. But it would have to be tailored to the very specific use case
>> and I don't know if such specific transformation would have wide-enough
>> applicability. If it would only speed-up String.hashCode and very
>> similar loops, it is less trouble to do that by hand in one or few
>> places...
> I would think this happens in user-specified hashCode() over arrays.
> IDEs would routinely inject the loop like that or delegate to
> Arrays.hashCode, that does the same loop.
> In other words, I would like to see this fixed on compiler side. This
> seems to be the strength-reduction playing tricks with loop unrolling,
> I'll submit a bug shortly.



More information about the core-libs-dev mailing list