File tree Expand file tree Collapse file tree
test/hotspot/jtreg/compiler/c2/aarch64 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -89,15 +89,19 @@ private static void checkOutput(OutputAnalyzer output) {
8989 }
9090
9191 static class Test {
92- private static void test (String s , int i ) {
92+ // Use a StringBuilder to avoid issues with String.charAt() not being
93+ // inlined on Windows because its UTF-16 path was executed at startup
94+ // but not enough for C2 to inline it.
95+ private static void test (StringBuilder s , int i ) {
9396 if (s .charAt (i ) > 128 )
9497 throw new RuntimeException ();
9598 }
9699
97100 public static void main (String [] args ) {
98- String s = "Returns the char value at the specified index." ;
101+ var sb = new StringBuilder ();
102+ sb .append ("Returns the char value at the specified index." );
99103 for (int i = 0 ; i < ITERATIONS_TO_HEAT_LOOP ; ++i ) {
100- test (s , i % s .length ());
104+ test (sb , i % sb .length ());
101105 }
102106 }
103107 }
You can’t perform that action at this time.
0 commit comments