8173585: Intrinsify StringLatin1.indexOf(char)

Reviewed-by: neliasso
This commit is contained in:
Jason Tatton (AWS) 2020-10-14 12:58:21 +00:00 committed by Paul Hohensee
parent 95e68c6346
commit f71e8a6198
15 changed files with 613 additions and 16 deletions

View file

@ -210,6 +210,11 @@ final class StringLatin1 {
// Note: fromIndex might be near -1>>>1.
return -1;
}
return indexOfChar(value, ch, fromIndex, max);
}
@HotSpotIntrinsicCandidate
private static int indexOfChar(byte[] value, int ch, int fromIndex, int max) {
byte c = (byte)ch;
for (int i = fromIndex; i < max; i++) {
if (value[i] == c) {