Skip to content

Commit

Permalink
8313676: Amend TestLoadIndexedMismatch test to target intrinsic directly
Browse files Browse the repository at this point in the history
Reviewed-by: thartmann, chagedorn
  • Loading branch information
shipilev committed Aug 7, 2023
1 parent 0b4387e commit 4b192a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/hotspot/jtreg/compiler/c1/TestLoadIndexedMismatch.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ public static char[] getChars(byte[] value, int srcBegin, int srcEnd, int dstSiz
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);
}
Expand Down

1 comment on commit 4b192a8

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.