Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8243625: [lworld] Co-evolve hotspot-compiler tests along with JDK-8237072 #30

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1251,7 +1251,8 @@ public void test50_verifier(boolean warmup) {

@Test
public MyValue1[] test51(MyValue1[] va) {
return Arrays.copyOf(va, va.length, MyValue1[].class);
// TODO Remove cast as workaround once javac is fixed
return (MyValue1[])Arrays.copyOf(va, va.length, MyValue1[].class);
}

@DontCompile
@@ -1269,7 +1270,8 @@ public void test51_verifier(boolean warmup) {

@Test
public MyValue1[] test52() {
return Arrays.copyOf(test52_va, 8, MyValue1[].class);
// TODO Remove cast as workaround once javac is fixed
return (MyValue1[])Arrays.copyOf(test52_va, 8, MyValue1[].class);
}

@DontCompile
@@ -1283,7 +1285,8 @@ public void test52_verifier(boolean warmup) {

@Test
public MyValue1[] test53(Object[] va) {
return Arrays.copyOf(va, va.length, MyValue1[].class);
// TODO Remove cast as workaround once javac is fixed
return (MyValue1[])Arrays.copyOf(va, va.length, MyValue1[].class);
}

@DontCompile
@@ -1331,7 +1334,8 @@ public void test55_verifier(boolean warmup) {

@Test
public MyValue1[] test56(Object[] va) {
return Arrays.copyOf(va, va.length, MyValue1[].class);
// TODO Remove cast as workaround once javac is fixed
return (MyValue1[])Arrays.copyOf(va, va.length, MyValue1[].class);
}

@DontCompile
@@ -36,18 +36,20 @@
* @library /testlibrary /test/lib /compiler/whitebox /
* @modules java.base/jdk.internal.misc
* @run main/othervm -XX:ValueFieldMaxFlatSize=0 -XX:ValueArrayElemMaxFlatSize=0
* -XX:+StressGCM -XX:+StressLCM
* -XX:+UnlockDiagnosticVMOptions -XX:+StressGCM -XX:+StressLCM
* compiler.valhalla.valuetypes.TestBufferTearing
* @run main/othervm -XX:ValueFieldMaxFlatSize=0 -XX:ValueArrayElemMaxFlatSize=0
* -XX:+StressGCM -XX:+StressLCM -XX:+AlwaysIncrementalInline
* -XX:+UnlockDiagnosticVMOptions -XX:+StressGCM -XX:+StressLCM
* -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline
* compiler.valhalla.valuetypes.TestBufferTearing
* @run main/othervm -XX:ValueFieldMaxFlatSize=0 -XX:ValueArrayElemMaxFlatSize=0
* -XX:CompileCommand=dontinline,*::incrementAndCheck*
* -XX:+StressGCM -XX:+StressLCM
* -XX:+UnlockDiagnosticVMOptions -XX:+StressGCM -XX:+StressLCM
* compiler.valhalla.valuetypes.TestBufferTearing
* @run main/othervm -XX:ValueFieldMaxFlatSize=0 -XX:ValueArrayElemMaxFlatSize=0
* -XX:CompileCommand=dontinline,*::incrementAndCheck*
* -XX:+StressGCM -XX:+StressLCM -XX:+AlwaysIncrementalInline
* -XX:+UnlockDiagnosticVMOptions -XX:+StressGCM -XX:+StressLCM
* -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline
* compiler.valhalla.valuetypes.TestBufferTearing
*/

@@ -107,17 +107,19 @@ public Class<?> test3(Class<?> cls) {

public void test3_verifier(boolean warmup) {
Asserts.assertTrue(test3(Object.class) == null, "test3_1 failed");
Asserts.assertTrue(test3(MyValue1.class.asIndirectType()) == Object.class, "test3_2 failed");
Asserts.assertTrue(test3(MyValue1.class.asPrimaryType()) == Object.class, "test3_3 failed");
Asserts.assertTrue(test3(MyValue1.class.asIndirectType()) == MyValue1.ref.class, "test3_2 failed");
Asserts.assertTrue(test3(MyValue1.class.asPrimaryType()) == MyValue1.ref.class, "test3_3 failed");
Asserts.assertTrue(test3(Class.class) == Object.class, "test3_4 failed");
}

// Verify that Class::getSuperclass checks with statically known classes are folded
@Test(failOn = LOADK)
public boolean test4() {
boolean check1 = Object.class.getSuperclass() == null;
boolean check2 = MyValue1.class.asIndirectType().getSuperclass() == MyValue1.ref.class;
boolean check3 = MyValue1.class.asPrimaryType().getSuperclass() == MyValue1.ref.class;
// TODO Remove cast as workaround once javac is fixed
boolean check2 = (Class<?>)MyValue1.class.asIndirectType().getSuperclass() == MyValue1.ref.class;
// TODO Remove cast as workaround once javac is fixed
boolean check3 = (Class<?>)MyValue1.class.asPrimaryType().getSuperclass() == MyValue1.ref.class;
boolean check4 = Class.class.getSuperclass() == Object.class;
return check1 && check2 && check3 && check4;
}
@@ -434,7 +436,8 @@ public Test25Value() {

@Test
public Test25Value[] test25(Test25Value element) {
Test25Value[] newArray = Arrays.copyOf(test25Array, test25Array.length + 1);
// TODO Remove cast as workaround once javac is fixed
Test25Value[] newArray = (Test25Value[])Arrays.copyOf(test25Array, test25Array.length + 1);
newArray[test25Array.length] = element;
return newArray;
}