22 */
23
24 package jdk.vm.ci.hotspot;
25
26 import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime;
27 import static jdk.vm.ci.inittimer.InitTimer.timer;
28
29 import java.lang.reflect.Constructor;
30 import java.lang.reflect.Method;
31
32 import jdk.vm.ci.code.BytecodeFrame;
33 import jdk.vm.ci.code.InstalledCode;
34 import jdk.vm.ci.code.InvalidInstalledCodeException;
35 import jdk.vm.ci.code.TargetDescription;
36 import jdk.vm.ci.common.JVMCIError;
37 import jdk.vm.ci.hotspotvmconfig.HotSpotVMField;
38 import jdk.vm.ci.inittimer.InitTimer;
39 import jdk.vm.ci.meta.JavaType;
40 import jdk.vm.ci.meta.ResolvedJavaMethod;
41 import jdk.vm.ci.meta.ResolvedJavaType;
42 import sun.misc.Unsafe;
43
44 /**
45 * Calls from Java into HotSpot. The behavior of all the methods in this class that take a native
46 * pointer as an argument (e.g., {@link #getSymbol(long)}) is undefined if the argument does not
47 * denote a valid native object.
48 */
49 final class CompilerToVM {
50 /**
51 * Initializes the native part of the JVMCI runtime.
52 */
53 private static native void registerNatives();
54
55 static {
56 initialize();
57 }
58
59 @SuppressWarnings("try")
60 private static void initialize() {
61 try (InitTimer t = timer("CompilerToVM.registerNatives")) {
62 registerNatives();
|
22 */
23
24 package jdk.vm.ci.hotspot;
25
26 import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime;
27 import static jdk.vm.ci.inittimer.InitTimer.timer;
28
29 import java.lang.reflect.Constructor;
30 import java.lang.reflect.Method;
31
32 import jdk.vm.ci.code.BytecodeFrame;
33 import jdk.vm.ci.code.InstalledCode;
34 import jdk.vm.ci.code.InvalidInstalledCodeException;
35 import jdk.vm.ci.code.TargetDescription;
36 import jdk.vm.ci.common.JVMCIError;
37 import jdk.vm.ci.hotspotvmconfig.HotSpotVMField;
38 import jdk.vm.ci.inittimer.InitTimer;
39 import jdk.vm.ci.meta.JavaType;
40 import jdk.vm.ci.meta.ResolvedJavaMethod;
41 import jdk.vm.ci.meta.ResolvedJavaType;
42
43 /**
44 * Calls from Java into HotSpot. The behavior of all the methods in this class that take a native
45 * pointer as an argument (e.g., {@link #getSymbol(long)}) is undefined if the argument does not
46 * denote a valid native object.
47 */
48 final class CompilerToVM {
49 /**
50 * Initializes the native part of the JVMCI runtime.
51 */
52 private static native void registerNatives();
53
54 static {
55 initialize();
56 }
57
58 @SuppressWarnings("try")
59 private static void initialize() {
60 try (InitTimer t = timer("CompilerToVM.registerNatives")) {
61 registerNatives();
|