< prev index next >

test/compiler/jvmci/compilerToVM/ResolveMethodTest.java

Print this page




  35  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  36  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  37  *                   compiler.jvmci.compilerToVM.ResolveMethodTest
  38  */
  39 
  40 package compiler.jvmci.compilerToVM;
  41 
  42 import compiler.jvmci.common.CTVMUtilities;
  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 jdk.internal.misc.Unsafe;
  53 import jdk.test.lib.Asserts;
  54 import jdk.test.lib.Utils;
  55 import jdk.test.lib.unsafe.UnsafeHelper;
  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 = UnsafeHelper.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));
  83         // an array method
  84         result.add(new TestCase(int[].class, Object.class, "toString",




  35  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  36  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  37  *                   compiler.jvmci.compilerToVM.ResolveMethodTest
  38  */
  39 
  40 package compiler.jvmci.compilerToVM;
  41 
  42 import compiler.jvmci.common.CTVMUtilities;
  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 jdk.internal.misc.Unsafe;
  53 import jdk.test.lib.Asserts;
  54 import jdk.test.lib.Utils;

  55 import jdk.vm.ci.hotspot.CompilerToVMHelper;
  56 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
  57 import jdk.vm.ci.hotspot.HotSpotResolvedObjectType;
  58 
  59 import java.util.HashSet;
  60 import java.util.Set;
  61 
  62 public class ResolveMethodTest {
  63     private static final Unsafe UNSAFE = Unsafe.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));
  82         // an array method
  83         result.add(new TestCase(int[].class, Object.class, "toString",


< prev index next >