8332826: Make hashCode methods in ArraysSupport friendlier

Reviewed-by: redestad, liach
This commit is contained in:
Pavel Rappo 2024-05-30 09:33:30 +00:00
parent 2b4a4b7bd8
commit 3cff588a31
13 changed files with 234 additions and 80 deletions

View file

@ -290,8 +290,7 @@ class ZipCoder {
// exceptions eagerly when opening ZipFiles
return hash(JLA.newStringUTF8NoRepl(a, off, len));
}
// T_BOOLEAN to treat the array as unsigned bytes, in line with StringLatin1.hashCode
int h = ArraysSupport.vectorizedHashCode(a, off, len, 0, ArraysSupport.T_BOOLEAN);
int h = ArraysSupport.hashCodeOfUnsigned(a, off, len, 0);
if (a[end - 1] != '/') {
h = 31 * h + '/';
}