RFR: 8282664: Unroll by hand StringUTF16 and StringLatin1 polynomial hash loops [v12]

Claes Redestad redestad at openjdk.org
Fri Nov 11 12:43:15 UTC 2022


On Fri, 11 Nov 2022 12:36:20 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> Claes Redestad has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Qualified guess on shenandoahSupport fix-up
>
> src/java.base/share/classes/java/lang/StringLatin1.java line 194:
> 
>> 192:         return switch (value.length) {
>> 193:             case 0 -> 0;
>> 194:             case 1 -> value[0];
> 
> shouldn't that be: 
> 
>     case 1 -> value[0] & 0xff;

Yes, good catch. I'll add a test case for negative latin1 bytes, too.

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

PR: https://git.openjdk.org/jdk/pull/10847


More information about the core-libs-dev mailing list