On Tue, 18 May 2021 18:06:21 GMT, Nils Eliasson <nelia...@openjdk.org> wrote:

>> src/java.base/share/classes/java/util/DualPivotQuicksort.java line 672:
>> 
>>> 670:             count2[(a[i] >>>  8) & 0xFF]--;
>>> 671:             count3[(a[i] >>> 16) & 0xFF]--;
>>> 672:             count4[(a[i] >>> 24) ^ 0x80]--;
>> 
>> It seems that C2 can't eliminate the bounds check here because of the `xor`, 
>> even though this can't possibly exceed 256. The three masked accesses above 
>> are all eliminated. Maybe someone could look in to improving that.
>
> https://bugs.openjdk.java.net/browse/JDK-8267332

I agree with Laurent (bourgesl), see his comment on May 15 regarding to xor:
using Unsafe is only 2% faster, not worth the extra complexity for few percent.

-------------

PR: https://git.openjdk.java.net/jdk/pull/3938

Reply via email to