hotspot/test/compiler/jvmci/compilerToVM/JVM_RegisterJVMCINatives.java
changeset 33632 038347770a9e
parent 33160 c59f1676d27e
child 35148 5cfafc99d791
equal deleted inserted replaced
33631:3eee32561662 33632:038347770a9e
    20  * or visit www.oracle.com if you need additional information or have any
    20  * or visit www.oracle.com if you need additional information or have any
    21  * questions.
    21  * questions.
    22  *
    22  *
    23  */
    23  */
    24 
    24 
    25 /**
    25 /*
    26  * @test
    26  * @test
    27  * @bug 8136421
    27  * @bug 8136421
    28  * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64"
    28  * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64"
    29  * @library /testlibrary /
    29  * @library /testlibrary /
    30  * @run main/othervm -XX:+UnlockExperimentalVMOptions
    30  * @run main/othervm -XX:+UnlockExperimentalVMOptions
    38 
    38 
    39  */
    39  */
    40 
    40 
    41 package compiler.jvmci.compilerToVM;
    41 package compiler.jvmci.compilerToVM;
    42 
    42 
    43 import jdk.vm.ci.hotspot.CompilerToVM;
       
    44 import jdk.vm.ci.runtime.JVMCI;
    43 import jdk.vm.ci.runtime.JVMCI;
    45 import jdk.test.lib.Asserts;
    44 import jdk.test.lib.Asserts;
    46 
    45 
    47 import java.lang.reflect.Method;
    46 import java.lang.reflect.Method;
    48 
    47 
    86     }
    85     }
    87 
    86 
    88     private JVM_RegisterJVMCINatives() {
    87     private JVM_RegisterJVMCINatives() {
    89         Method method;
    88         Method method;
    90         try {
    89         try {
    91             method = CompilerToVM.class.getDeclaredMethod("registerNatives");
    90             method = Class.forName("jdk.vm.ci.hotspot.CompilerToVM",
       
    91                     /* initialize = */ false,
       
    92                     this.getClass().getClassLoader())
       
    93                     .getDeclaredMethod("registerNatives");
    92             method.setAccessible(true);
    94             method.setAccessible(true);
    93         } catch (NoSuchMethodException e) {
    95         } catch (ReflectiveOperationException e) {
    94             throw new Error("can't find CompilerToVM::registerNatives", e);
    96             throw new Error("can't find CompilerToVM::registerNatives", e);
    95         }
    97         }
    96         registerNatives = method;
    98         registerNatives = method;
    97     }
    99     }
    98 }
   100 }