mirror of
https://github.com/openjdk/jdk.git
synced 2026-07-02 15:20:27 +00:00
8378892: TestTrampoline fails on Windows AArch64
Reviewed-by: dlong, macarte
This commit is contained in:
parent
548a95379f
commit
dc4b150bcf
@ -89,15 +89,19 @@ public class TestTrampoline {
|
||||
}
|
||||
|
||||
static class Test {
|
||||
private static void test(String s, int i) {
|
||||
// Use a StringBuilder to avoid issues with String.charAt() not being
|
||||
// inlined on Windows because its UTF-16 path was executed at startup
|
||||
// but not enough for C2 to inline it.
|
||||
private static void test(StringBuilder s, int i) {
|
||||
if (s.charAt(i) > 128)
|
||||
throw new RuntimeException();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String s = "Returns the char value at the specified index.";
|
||||
var sb = new StringBuilder();
|
||||
sb.append("Returns the char value at the specified index.");
|
||||
for (int i = 0; i < ITERATIONS_TO_HEAT_LOOP; ++i) {
|
||||
test(s, i % s.length());
|
||||
test(sb, i % sb.length());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user