hotspot/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java
changeset 33632 038347770a9e
parent 33160 c59f1676d27e
child 33813 4f376e851453
equal deleted inserted replaced
33631:3eee32561662 33632:038347770a9e
    40 import java.lang.invoke.MethodHandle;
    40 import java.lang.invoke.MethodHandle;
    41 import java.lang.invoke.MethodType;
    41 import java.lang.invoke.MethodType;
    42 import java.util.HashMap;
    42 import java.util.HashMap;
    43 import java.util.Map;
    43 import java.util.Map;
    44 import jdk.vm.ci.hotspot.CompilerToVMHelper;
    44 import jdk.vm.ci.hotspot.CompilerToVMHelper;
    45 import jdk.vm.ci.hotspot.HotSpotConstantPool;
       
    46 import jdk.test.lib.Asserts;
    45 import jdk.test.lib.Asserts;
    47 import sun.reflect.ConstantPool;
    46 import sun.reflect.ConstantPool;
    48 
    47 
    49 /**
    48 /**
    50  * Test for {@code compiler.jvmci.CompilerToVM.resolveConstantInPool} method
    49  * Test for {@code compiler.jvmci.CompilerToVM.resolveConstantInPool} method
    60                 ResolveConstantInPoolTest::validateMethodType);
    59                 ResolveConstantInPoolTest::validateMethodType);
    61         ConstantPoolTestCase testCase = new ConstantPoolTestCase(typeTests);
    60         ConstantPoolTestCase testCase = new ConstantPoolTestCase(typeTests);
    62         testCase.test();
    61         testCase.test();
    63     }
    62     }
    64 
    63 
    65     private static void validateMethodHandle(HotSpotConstantPool constantPoolCTVM,
    64     private static void validateMethodHandle(
       
    65             jdk.vm.ci.meta.ConstantPool constantPoolCTVM,
    66             ConstantPool constantPoolSS,
    66             ConstantPool constantPoolSS,
    67             ConstantPoolTestsHelper.DummyClasses dummyClass, int index) {
    67             ConstantPoolTestsHelper.DummyClasses dummyClass, int index) {
    68         Object constantInPool = CompilerToVMHelper
    68         Object constantInPool = CompilerToVMHelper
    69                 .resolveConstantInPool(constantPoolCTVM, index);
    69                 .resolveConstantInPool(constantPoolCTVM, index);
    70         if (!(constantInPool instanceof MethodHandle)) {
    70         if (!(constantInPool instanceof MethodHandle)) {
    75                     MethodHandle.class.getName());
    75                     MethodHandle.class.getName());
    76             throw new AssertionError(msg);
    76             throw new AssertionError(msg);
    77         }
    77         }
    78     }
    78     }
    79 
    79 
    80     private static void validateMethodType(HotSpotConstantPool constantPoolCTVM,
    80     private static void validateMethodType(
       
    81             jdk.vm.ci.meta.ConstantPool constantPoolCTVM,
    81             ConstantPool constantPoolSS,
    82             ConstantPool constantPoolSS,
    82             ConstantPoolTestsHelper.DummyClasses dummyClass, int index) {
    83             ConstantPoolTestsHelper.DummyClasses dummyClass, int index) {
    83         Object constantInPool = CompilerToVMHelper
    84         Object constantInPool = CompilerToVMHelper
    84                 .resolveConstantInPool(constantPoolCTVM, index);
    85                 .resolveConstantInPool(constantPoolCTVM, index);
    85         Class mtToVerify = constantInPool.getClass();
    86         Class mtToVerify = constantInPool.getClass();