21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 8141551
27 * @summary C2 can not handle returns with inccompatible interface arrays
28 * @modules java.base/jdk.internal.org.objectweb.asm
29 * java.base/jdk.internal.misc
30 * @library /test/lib /
31 *
32 * @build sun.hotspot.WhiteBox
33 * @run driver ClassFileInstaller sun.hotspot.WhiteBox
34 * sun.hotspot.WhiteBox$WhiteBoxPermission
35 * @run main/othervm
36 * -Xbootclasspath/a:.
37 * -XX:+UnlockDiagnosticVMOptions
38 * -XX:+WhiteBoxAPI
39 * -Xbatch
40 * -XX:-TieredCompilation
41 * -XX:CICompilerCount=1
42 * -XX:+PrintCompilation
43 * -XX:+PrintInlining
44 * -XX:CompileCommand=compileonly,MeetIncompatibleInterfaceArrays*::run
45 * -XX:CompileCommand=dontinline,compiler.types.TestMeetIncompatibleInterfaceArrays$Helper::createI2*
46 * -XX:CompileCommand=quiet
47 * compiler.types.TestMeetIncompatibleInterfaceArrays 0
48 * @run main/othervm
49 * -Xbootclasspath/a:.
50 * -XX:+UnlockDiagnosticVMOptions
51 * -XX:+WhiteBoxAPI
52 * -Xbatch
53 * -XX:-TieredCompilation
54 * -XX:CICompilerCount=1
55 * -XX:+PrintCompilation
56 * -XX:+PrintInlining
57 * -XX:CompileCommand=compileonly,MeetIncompatibleInterfaceArrays*::run
58 * -XX:CompileCommand=inline,compiler.types.TestMeetIncompatibleInterfaceArrays$Helper::createI2*
59 * -XX:CompileCommand=quiet
60 * compiler.types.TestMeetIncompatibleInterfaceArrays 1
61 * @run main/othervm
62 * -Xbootclasspath/a:.
63 * -XX:+UnlockDiagnosticVMOptions
64 * -XX:+WhiteBoxAPI
65 * -Xbatch
66 * -XX:CICompilerCount=2
67 * -XX:+PrintCompilation
68 * -XX:+PrintInlining
69 * -XX:CompileCommand=compileonly,MeetIncompatibleInterfaceArrays*::run
70 * -XX:CompileCommand=compileonly,compiler.types.TestMeetIncompatibleInterfaceArrays$Helper::createI2*
71 * -XX:CompileCommand=inline,compiler.types.TestMeetIncompatibleInterfaceArrays$Helper::createI2*
72 * -XX:CompileCommand=quiet
73 * compiler.types.TestMeetIncompatibleInterfaceArrays 2
74 *
75 * @author volker.simonis@gmail.com
76 */
77
78 package compiler.types;
79
80 import compiler.whitebox.CompilerWhiteBoxTest;
81 import jdk.internal.org.objectweb.asm.ClassWriter;
82 import jdk.internal.org.objectweb.asm.MethodVisitor;
83 import sun.hotspot.WhiteBox;
84
85 import java.io.FileOutputStream;
362 try {
363 m.invoke(null);
364 } catch (InvocationTargetException ite) {
365 if (good) {
366 throw ite;
367 } else {
368 if (ite.getCause() instanceof IncompatibleClassChangeError) {
369 System.out.println(" OK - catched InvocationTargetException("
370 + ite.getCause().getMessage() + ").");
371 } else {
372 throw ite;
373 }
374 }
375 }
376
377 int r_comp_level = WB.getMethodCompilationLevel(r);
378 System.out.println(" invokation of " + baseClassName + i + "ASM.test() [::" +
379 r.getName() + "() was compiled at tier " + r_comp_level + "]");
380
381 if (r_comp_level != level[pass][j]) {
382 throw new Exception("Method " + r + " must be compiled at tier " + r_comp_level + " !");
383 }
384
385 WB.deoptimizeMethod(r);
386 }
387 }
388 }
389 }
390 }
|
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 8141551
27 * @summary C2 can not handle returns with inccompatible interface arrays
28 * @modules java.base/jdk.internal.org.objectweb.asm
29 * java.base/jdk.internal.misc
30 * @library /test/lib /
31 *
32 * @build sun.hotspot.WhiteBox
33 * @run driver ClassFileInstaller sun.hotspot.WhiteBox
34 * sun.hotspot.WhiteBox$WhiteBoxPermission
35 * @run main/othervm
36 * -Xbootclasspath/a:.
37 * -XX:+UnlockDiagnosticVMOptions
38 * -XX:+WhiteBoxAPI
39 * -Xbatch
40 * -XX:-TieredCompilation
41 * -XX:TieredStopAtLevel=4
42 * -XX:CICompilerCount=1
43 * -XX:+PrintCompilation
44 * -XX:+PrintInlining
45 * -XX:CompileCommand=compileonly,MeetIncompatibleInterfaceArrays*::run
46 * -XX:CompileCommand=dontinline,compiler.types.TestMeetIncompatibleInterfaceArrays$Helper::createI2*
47 * -XX:CompileCommand=quiet
48 * compiler.types.TestMeetIncompatibleInterfaceArrays 0
49 * @run main/othervm
50 * -Xbootclasspath/a:.
51 * -XX:+UnlockDiagnosticVMOptions
52 * -XX:+WhiteBoxAPI
53 * -Xbatch
54 * -XX:-TieredCompilation
55 * -XX:TieredStopAtLevel=4
56 * -XX:CICompilerCount=1
57 * -XX:+PrintCompilation
58 * -XX:+PrintInlining
59 * -XX:CompileCommand=compileonly,MeetIncompatibleInterfaceArrays*::run
60 * -XX:CompileCommand=inline,compiler.types.TestMeetIncompatibleInterfaceArrays$Helper::createI2*
61 * -XX:CompileCommand=quiet
62 * compiler.types.TestMeetIncompatibleInterfaceArrays 1
63 * @run main/othervm
64 * -Xbootclasspath/a:.
65 * -XX:+UnlockDiagnosticVMOptions
66 * -XX:+WhiteBoxAPI
67 * -Xbatch
68 * -XX:+TieredCompilation
69 * -XX:TieredStopAtLevel=4
70 * -XX:CICompilerCount=2
71 * -XX:+PrintCompilation
72 * -XX:+PrintInlining
73 * -XX:CompileCommand=compileonly,MeetIncompatibleInterfaceArrays*::run
74 * -XX:CompileCommand=compileonly,compiler.types.TestMeetIncompatibleInterfaceArrays$Helper::createI2*
75 * -XX:CompileCommand=inline,compiler.types.TestMeetIncompatibleInterfaceArrays$Helper::createI2*
76 * -XX:CompileCommand=quiet
77 * compiler.types.TestMeetIncompatibleInterfaceArrays 2
78 *
79 * @author volker.simonis@gmail.com
80 */
81
82 package compiler.types;
83
84 import compiler.whitebox.CompilerWhiteBoxTest;
85 import jdk.internal.org.objectweb.asm.ClassWriter;
86 import jdk.internal.org.objectweb.asm.MethodVisitor;
87 import sun.hotspot.WhiteBox;
88
89 import java.io.FileOutputStream;
366 try {
367 m.invoke(null);
368 } catch (InvocationTargetException ite) {
369 if (good) {
370 throw ite;
371 } else {
372 if (ite.getCause() instanceof IncompatibleClassChangeError) {
373 System.out.println(" OK - catched InvocationTargetException("
374 + ite.getCause().getMessage() + ").");
375 } else {
376 throw ite;
377 }
378 }
379 }
380
381 int r_comp_level = WB.getMethodCompilationLevel(r);
382 System.out.println(" invokation of " + baseClassName + i + "ASM.test() [::" +
383 r.getName() + "() was compiled at tier " + r_comp_level + "]");
384
385 if (r_comp_level != level[pass][j]) {
386 throw new Exception("Method " + r + " must be compiled at tier " + level[pass][j] +
387 " but was compiled at " + r_comp_level + " instead!");
388 }
389
390 WB.deoptimizeMethod(r);
391 }
392 }
393 }
394 }
395 }
|