8313676: Amend TestLoadIndexedMismatch test to target intrinsic directly

Reviewed-by: thartmann, chagedorn
This commit is contained in:
Aleksey Shipilev 2023-08-07 11:26:08 +00:00
parent 0b4387e3a3
commit 4b192a8dc3
2 changed files with 7 additions and 2 deletions

View file

@ -42,8 +42,8 @@ public class TestLoadIndexedMismatch {
public static char work() {
// LoadIndexed (B)
byte b = ARR[0];
// StringUTF16.charAt intrinsic, LoadIndexed (C)
char c = Helper.charAt(ARR, 0);
// StringUTF16.getChar intrinsic, LoadIndexed (C)
char c = Helper.getChar(ARR, 0);
return c;
}

View file

@ -77,6 +77,11 @@ public class Helper {
return dst;
}
@jdk.internal.vm.annotation.ForceInline
public static char getChar(byte[] value, int index) {
return StringUTF16.getChar(value, index);
}
public static void putCharSB(byte[] val, int index, int c) {
StringUTF16.putCharSB(val, index, c);
}