mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8173585: Intrinsify StringLatin1.indexOf(char)
Reviewed-by: neliasso
This commit is contained in:
parent
95e68c6346
commit
f71e8a6198
15 changed files with 613 additions and 16 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue