From 4b192a8dc37297f0746c0c68322e0168d9f47771 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 7 Aug 2023 11:26:08 +0000 Subject: [PATCH] 8313676: Amend TestLoadIndexedMismatch test to target intrinsic directly Reviewed-by: thartmann, chagedorn --- test/hotspot/jtreg/compiler/c1/TestLoadIndexedMismatch.java | 4 ++-- .../jtreg/compiler/patches/java.base/java/lang/Helper.java | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/test/hotspot/jtreg/compiler/c1/TestLoadIndexedMismatch.java b/test/hotspot/jtreg/compiler/c1/TestLoadIndexedMismatch.java index d16b6b0c684..2f983692f38 100644 --- a/test/hotspot/jtreg/compiler/c1/TestLoadIndexedMismatch.java +++ b/test/hotspot/jtreg/compiler/c1/TestLoadIndexedMismatch.java @@ -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; } diff --git a/test/hotspot/jtreg/compiler/patches/java.base/java/lang/Helper.java b/test/hotspot/jtreg/compiler/patches/java.base/java/lang/Helper.java index 6d8b5be79bf..49cb89b6f7f 100644 --- a/test/hotspot/jtreg/compiler/patches/java.base/java/lang/Helper.java +++ b/test/hotspot/jtreg/compiler/patches/java.base/java/lang/Helper.java @@ -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); }