23
24 /*
25 * @test
26 * @bug 8136421
27 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
28 * @library / /testlibrary /test/lib
29 * @library ../common/patches
30 * @modules java.base/jdk.internal.misc
31 * @modules java.base/jdk.internal.org.objectweb.asm
32 * java.base/jdk.internal.org.objectweb.asm.tree
33 * jdk.vm.ci/jdk.vm.ci.hotspot
34 * jdk.vm.ci/jdk.vm.ci.code
35 * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
36 * @build compiler.jvmci.compilerToVM.ResolveMethodTest
37 * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
38 * compiler.jvmci.compilerToVM.ResolveMethodTest
39 */
40
41 package compiler.jvmci.compilerToVM;
42
43 import compiler.jvmci.common.testcases.AbstractClass;
44 import compiler.jvmci.common.testcases.AbstractClassExtender;
45 import compiler.jvmci.common.testcases.MultipleImplementer1;
46 import compiler.jvmci.common.testcases.MultipleImplementer2;
47 import compiler.jvmci.common.testcases.MultipleImplementersInterface;
48 import compiler.jvmci.common.testcases.SingleImplementer;
49 import compiler.jvmci.common.testcases.SingleImplementerInterface;
50 import compiler.jvmci.common.testcases.SingleSubclass;
51 import compiler.jvmci.common.testcases.SingleSubclassedClass;
52 import compiler.jvmci.common.CTVMUtilities;
53 import java.util.HashSet;
54 import java.util.Set;
55 import jdk.vm.ci.hotspot.CompilerToVMHelper;
56 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
57 import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
58 import jdk.test.lib.Asserts;
59 import jdk.test.lib.Utils;
60 import jdk.internal.misc.Unsafe;
61
62 public class ResolveMethodTest {
63 private static final Unsafe UNSAFE = Utils.getUnsafe();
64
65 public static void main(String args[]) {
66 ResolveMethodTest test = new ResolveMethodTest();
67 // positive cases
68 try {
69 for (TestCase tcase: createTestCases()) {
70 test.runTest(tcase);
71 }
72 } catch (NoSuchMethodException e) {
73 throw new Error("TEST BUG: can't find requested method", e);
74 }
75 }
76
77 private static Set<TestCase> createTestCases() {
78 Set<TestCase> result = new HashSet<>();
79 // a usual class public method
80 result.add(new TestCase(SingleSubclass.class, SingleSubclass.class,
81 "usualMethod", ResolveMethodTest.class, true));
|
23
24 /*
25 * @test
26 * @bug 8136421
27 * @requires (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9" | vm.simpleArch == "aarch64")
28 * @library / /testlibrary /test/lib
29 * @library ../common/patches
30 * @modules java.base/jdk.internal.misc
31 * @modules java.base/jdk.internal.org.objectweb.asm
32 * java.base/jdk.internal.org.objectweb.asm.tree
33 * jdk.vm.ci/jdk.vm.ci.hotspot
34 * jdk.vm.ci/jdk.vm.ci.code
35 * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
36 * @build compiler.jvmci.compilerToVM.ResolveMethodTest
37 * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
38 * compiler.jvmci.compilerToVM.ResolveMethodTest
39 */
40
41 package compiler.jvmci.compilerToVM;
42
43 import compiler.jvmci.common.CTVMUtilities;
44 import compiler.jvmci.common.testcases.AbstractClass;
45 import compiler.jvmci.common.testcases.AbstractClassExtender;
46 import compiler.jvmci.common.testcases.MultipleImplementer1;
47 import compiler.jvmci.common.testcases.MultipleImplementer2;
48 import compiler.jvmci.common.testcases.MultipleImplementersInterface;
49 import compiler.jvmci.common.testcases.SingleImplementer;
50 import compiler.jvmci.common.testcases.SingleImplementerInterface;
51 import compiler.jvmci.common.testcases.SingleSubclass;
52 import compiler.jvmci.common.testcases.SingleSubclassedClass;
53 import jdk.internal.misc.Unsafe;
54 import jdk.test.lib.Asserts;
55 import jdk.test.lib.Utils;
56 import jdk.vm.ci.hotspot.CompilerToVMHelper;
57 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
58 import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
59
60 import java.util.HashSet;
61 import java.util.Set;
62
63 public class ResolveMethodTest {
64 private static final Unsafe UNSAFE = Utils.getUnsafe();
65
66 public static void main(String args[]) {
67 ResolveMethodTest test = new ResolveMethodTest();
68 // positive cases
69 try {
70 for (TestCase tcase: createTestCases()) {
71 test.runTest(tcase);
72 }
73 } catch (NoSuchMethodException e) {
74 throw new Error("TEST BUG: can't find requested method", e);
75 }
76 }
77
78 private static Set<TestCase> createTestCases() {
79 Set<TestCase> result = new HashSet<>();
80 // a usual class public method
81 result.add(new TestCase(SingleSubclass.class, SingleSubclass.class,
82 "usualMethod", ResolveMethodTest.class, true));
|