< prev index next >
test/compiler/types/TestMeetIncompatibleInterfaceArrays.java
Print this page
rev 11557 : 8132919: use package in compiler tests
Reviewed-by: duke
@@ -26,12 +26,13 @@
* @bug 8141551
* @summary C2 can not handle returns with inccompatible interface arrays
* @modules java.base/jdk.internal.org.objectweb.asm
* java.base/jdk.internal.misc
* @library /testlibrary /test/lib
+ *
* @build sun.hotspot.WhiteBox
- * @run main ClassFileInstaller sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/othervm
* -Xbootclasspath/a:.
* -XX:+UnlockDiagnosticVMOptions
* -XX:+WhiteBoxAPI
@@ -39,14 +40,14 @@
* -XX:CompileThreshold=1
* -XX:-TieredCompilation
* -XX:CICompilerCount=1
* -XX:+PrintCompilation
* -XX:+PrintInlining
- * -XX:CompileCommand=compileonly,MeetIncompatibleInterfaceArrays*.run
- * -XX:CompileCommand=dontinline,TestMeetIncompatibleInterfaceArrays$Helper.createI2*
+ * -XX:CompileCommand=compileonly,MeetIncompatibleInterfaceArrays*::run
+ * -XX:CompileCommand=dontinline,compiler.types.TestMeetIncompatibleInterfaceArrays$Helper::createI2*
* -XX:CompileCommand=quiet
- * TestMeetIncompatibleInterfaceArrays 0
+ * compiler.types.TestMeetIncompatibleInterfaceArrays 0
* @run main/othervm
* -Xbootclasspath/a:.
* -XX:+UnlockDiagnosticVMOptions
* -XX:+WhiteBoxAPI
* -Xbatch
@@ -53,14 +54,14 @@
* -XX:CompileThreshold=1
* -XX:-TieredCompilation
* -XX:CICompilerCount=1
* -XX:+PrintCompilation
* -XX:+PrintInlining
- * -XX:CompileCommand=compileonly,MeetIncompatibleInterfaceArrays*.run
- * -XX:CompileCommand=inline,TestMeetIncompatibleInterfaceArrays$Helper.createI2*
+ * -XX:CompileCommand=compileonly,MeetIncompatibleInterfaceArrays*::run
+ * -XX:CompileCommand=inline,compiler.types.TestMeetIncompatibleInterfaceArrays$Helper::createI2*
* -XX:CompileCommand=quiet
- * TestMeetIncompatibleInterfaceArrays 1
+ * compiler.types.TestMeetIncompatibleInterfaceArrays 1
* @run main/othervm
* -Xbootclasspath/a:.
* -XX:+UnlockDiagnosticVMOptions
* -XX:+WhiteBoxAPI
* -Xbatch
@@ -70,27 +71,44 @@
* -XX:Tier4InvocationThreshold=1 -XX:Tier4MinInvocationThreshold=1 -XX:Tier4CompileThreshold=1
* -XX:+TieredCompilation
* -XX:CICompilerCount=2
* -XX:+PrintCompilation
* -XX:+PrintInlining
- * -XX:CompileCommand=compileonly,MeetIncompatibleInterfaceArrays*.run
- * -XX:CompileCommand=compileonly,TestMeetIncompatibleInterfaceArrays$Helper.createI2*
- * -XX:CompileCommand=inline,TestMeetIncompatibleInterfaceArrays$Helper.createI2*
+ * -XX:CompileCommand=compileonly,MeetIncompatibleInterfaceArrays*::run
+ * -XX:CompileCommand=compileonly,compiler.types.TestMeetIncompatibleInterfaceArrays$Helper::createI2*
+ * -XX:CompileCommand=inline,compiler.types.TestMeetIncompatibleInterfaceArrays$Helper::createI2*
* -XX:CompileCommand=quiet
- * TestMeetIncompatibleInterfaceArrays 2
+ * compiler.types.TestMeetIncompatibleInterfaceArrays 2
*
* @author volker.simonis@gmail.com
*/
-import java.io.FileOutputStream;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
+package compiler.types;
+
import jdk.internal.org.objectweb.asm.ClassWriter;
import jdk.internal.org.objectweb.asm.MethodVisitor;
-import static jdk.internal.org.objectweb.asm.Opcodes.*;
import sun.hotspot.WhiteBox;
+import java.io.FileOutputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import static jdk.internal.org.objectweb.asm.Opcodes.AALOAD;
+import static jdk.internal.org.objectweb.asm.Opcodes.ACC_PUBLIC;
+import static jdk.internal.org.objectweb.asm.Opcodes.ACC_STATIC;
+import static jdk.internal.org.objectweb.asm.Opcodes.ALOAD;
+import static jdk.internal.org.objectweb.asm.Opcodes.ARETURN;
+import static jdk.internal.org.objectweb.asm.Opcodes.ASTORE;
+import static jdk.internal.org.objectweb.asm.Opcodes.GETSTATIC;
+import static jdk.internal.org.objectweb.asm.Opcodes.ICONST_0;
+import static jdk.internal.org.objectweb.asm.Opcodes.INVOKEINTERFACE;
+import static jdk.internal.org.objectweb.asm.Opcodes.INVOKESPECIAL;
+import static jdk.internal.org.objectweb.asm.Opcodes.INVOKESTATIC;
+import static jdk.internal.org.objectweb.asm.Opcodes.INVOKEVIRTUAL;
+import static jdk.internal.org.objectweb.asm.Opcodes.RETURN;
+import static jdk.internal.org.objectweb.asm.Opcodes.V1_8;
+
public class TestMeetIncompatibleInterfaceArrays extends ClassLoader {
private static final WhiteBox WB = WhiteBox.getWhiteBox();
public static interface I1 { public String getName(); }
@@ -243,26 +261,26 @@
constr.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false);
constr.visitInsn(RETURN);
constr.visitMaxs(0, 0);
constr.visitEnd();
MethodVisitor run = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "run",
- "()" + a + "LTestMeetIncompatibleInterfaceArrays$I1;", null, null);
+ "()" + a + "Lcompiler/types/TestMeetIncompatibleInterfaceArrays$I1;", null, null);
run.visitCode();
if (dim == 4) {
- run.visitMethodInsn(INVOKESTATIC, "TestMeetIncompatibleInterfaceArrays$Helper", createName + 3,
- "()" + "[[[" + "LTestMeetIncompatibleInterfaceArrays$I2;", false);
+ run.visitMethodInsn(INVOKESTATIC, "compiler/types/TestMeetIncompatibleInterfaceArrays$Helper", createName + 3,
+ "()" + "[[[" + "Lcompiler/types/TestMeetIncompatibleInterfaceArrays$I2;", false);
} else {
- run.visitMethodInsn(INVOKESTATIC, "TestMeetIncompatibleInterfaceArrays$Helper", createName + dim,
- "()" + a + "LTestMeetIncompatibleInterfaceArrays$I2;", false);
+ run.visitMethodInsn(INVOKESTATIC, "compiler/types/TestMeetIncompatibleInterfaceArrays$Helper", createName + dim,
+ "()" + a + "Lcompiler/types/TestMeetIncompatibleInterfaceArrays$I2;", false);
}
run.visitInsn(ARETURN);
run.visitMaxs(0, 0);
run.visitEnd();
MethodVisitor test = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "test", "()V", null, null);
test.visitCode();
test.visitMethodInsn(INVOKESTATIC, baseClassName + dim + "ASM", "run",
- "()" + a + "LTestMeetIncompatibleInterfaceArrays$I1;", false);
+ "()" + a + "Lcompiler/types/TestMeetIncompatibleInterfaceArrays$I1;", false);
test.visitVarInsn(ASTORE, 0);
if (dim > 0) {
test.visitVarInsn(ALOAD, 0);
for (int i = 1; i <= dim; i++) {
test.visitInsn(ICONST_0);
@@ -270,11 +288,11 @@
}
test.visitVarInsn(ASTORE, 1);
}
test.visitFieldInsn(GETSTATIC, "java/lang/System", "out", "Ljava/io/PrintStream;");
test.visitVarInsn(ALOAD, dim > 0 ? 1 : 0);
- test.visitMethodInsn(INVOKEINTERFACE, "TestMeetIncompatibleInterfaceArrays$I1", "getName",
+ test.visitMethodInsn(INVOKEINTERFACE, "compiler/types/TestMeetIncompatibleInterfaceArrays$I1", "getName",
"()Ljava/lang/String;", true);
test.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "println", "(Ljava/lang/Object;)V", false);
test.visitInsn(RETURN);
test.visitMaxs(0, 0);
test.visitEnd();
@@ -294,13 +312,13 @@
public static void main(String[] args) throws Exception {
final int pass = Integer.parseInt(args.length > 0 ? args[0] : "0");
// Load and initialize some classes required for compilation
- Class.forName("TestMeetIncompatibleInterfaceArrays$I1");
- Class.forName("TestMeetIncompatibleInterfaceArrays$I2");
- Class.forName("TestMeetIncompatibleInterfaceArrays$Helper");
+ Class.forName("compiler.types.TestMeetIncompatibleInterfaceArrays$I1");
+ Class.forName("compiler.types.TestMeetIncompatibleInterfaceArrays$I2");
+ Class.forName("compiler.types.TestMeetIncompatibleInterfaceArrays$Helper");
for (int g = 0; g < 2; g++) {
String baseClassName = "MeetIncompatibleInterfaceArrays";
boolean good = (g == 0) ? false : true;
if (good)
< prev index next >