< prev index next >

test/compiler/jvmci/compilerToVM/GetSymbolTest.java

Print this page




  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  *          jdk.vm.ci/jdk.vm.ci.meta
  36  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  37  * @build compiler.jvmci.compilerToVM.GetSymbolTest
  38  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  39  *                  compiler.jvmci.compilerToVM.GetSymbolTest
  40  */
  41 
  42 package compiler.jvmci.compilerToVM;
  43 
  44 import jdk.vm.ci.hotspot.CompilerToVMHelper;
  45 import compiler.jvmci.common.CTVMUtilities;
  46 import compiler.jvmci.common.testcases.SingleImplementer;





  47 import java.lang.reflect.Field;
  48 import java.lang.reflect.Member;
  49 import java.lang.reflect.Method;
  50 import java.util.ArrayList;
  51 import java.util.List;
  52 import java.util.function.Function;
  53 import java.util.stream.Collectors;
  54 import java.util.stream.Stream;
  55 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
  56 import jdk.vm.ci.meta.ConstantPool;
  57 import jdk.test.lib.Utils;
  58 
  59 public class GetSymbolTest {
  60     private static final int CONSTANT_POOL_UTF8_TAG = 1; // see jvms, section 4.4
  61 
  62     private static final Function<Member[], List<String>> NAMES = members ->
  63             Stream.of(members)
  64                     .map(Member::getName)
  65                     .collect(Collectors.toList());
  66 
  67     public static void main(String[] args) {
  68         new GetSymbolTest().test(SingleImplementer.class);
  69     }
  70 
  71     private void test(Class<?> aClass) {
  72         Utils.ensureClassIsLoaded(aClass);
  73         Method method;
  74         try {
  75             method = aClass.getDeclaredMethod("nonInterfaceMethod");
  76         } catch (NoSuchMethodException e) {
  77             throw new Error("TEST BUG: can't find test method", e);




  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  *          jdk.vm.ci/jdk.vm.ci.meta
  36  * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
  37  * @build compiler.jvmci.compilerToVM.GetSymbolTest
  38  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
  39  *                  compiler.jvmci.compilerToVM.GetSymbolTest
  40  */
  41 
  42 package compiler.jvmci.compilerToVM;
  43 

  44 import compiler.jvmci.common.CTVMUtilities;
  45 import compiler.jvmci.common.testcases.SingleImplementer;
  46 import jdk.test.lib.Utils;
  47 import jdk.vm.ci.hotspot.CompilerToVMHelper;
  48 import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
  49 import jdk.vm.ci.meta.ConstantPool;
  50 
  51 import java.lang.reflect.Field;
  52 import java.lang.reflect.Member;
  53 import java.lang.reflect.Method;
  54 import java.util.ArrayList;
  55 import java.util.List;
  56 import java.util.function.Function;
  57 import java.util.stream.Collectors;
  58 import java.util.stream.Stream;



  59 
  60 public class GetSymbolTest {
  61     private static final int CONSTANT_POOL_UTF8_TAG = 1; // see jvms, section 4.4
  62 
  63     private static final Function<Member[], List<String>> NAMES = members ->
  64             Stream.of(members)
  65                     .map(Member::getName)
  66                     .collect(Collectors.toList());
  67 
  68     public static void main(String[] args) {
  69         new GetSymbolTest().test(SingleImplementer.class);
  70     }
  71 
  72     private void test(Class<?> aClass) {
  73         Utils.ensureClassIsLoaded(aClass);
  74         Method method;
  75         try {
  76             method = aClass.getDeclaredMethod("nonInterfaceMethod");
  77         } catch (NoSuchMethodException e) {
  78             throw new Error("TEST BUG: can't find test method", e);


< prev index next >