25
26 package java.lang;
27
28 /**
29 * The {@code Compiler} class is provided to support Java-to-native-code
30 * compilers and related services. By design, the {@code Compiler} class does
31 * nothing; it serves as a placeholder for a JIT compiler implementation.
32 *
33 * <p> When the Java Virtual Machine first starts, it determines if the system
34 * property {@code java.compiler} exists. (System properties are accessible
35 * through {@link System#getProperty(String)} and {@link
36 * System#getProperty(String, String)}. If so, it is assumed to be the name of
37 * a library (with a platform-dependent exact location and type); {@link
38 * System#loadLibrary} is called to load that library. If this loading
39 * succeeds, the function named {@code java_lang_Compiler_start()} in that
40 * library is called.
41 *
42 * <p> If no compiler is available, these methods do nothing.
43 *
44 * @author Frank Yellin
45 * @since JDK1.0
46 */
47 public final class Compiler {
48 private Compiler() {} // don't make instances
49
50 private static native void initialize();
51
52 private static native void registerNatives();
53
54 static {
55 registerNatives();
56 java.security.AccessController.doPrivileged(
57 new java.security.PrivilegedAction<Void>() {
58 public Void run() {
59 boolean loaded = false;
60 String jit = System.getProperty("java.compiler");
61 if ((jit != null) && (!jit.equals("NONE")) &&
62 (!jit.equals("")))
63 {
64 try {
65 System.loadLibrary(jit);
|
25
26 package java.lang;
27
28 /**
29 * The {@code Compiler} class is provided to support Java-to-native-code
30 * compilers and related services. By design, the {@code Compiler} class does
31 * nothing; it serves as a placeholder for a JIT compiler implementation.
32 *
33 * <p> When the Java Virtual Machine first starts, it determines if the system
34 * property {@code java.compiler} exists. (System properties are accessible
35 * through {@link System#getProperty(String)} and {@link
36 * System#getProperty(String, String)}. If so, it is assumed to be the name of
37 * a library (with a platform-dependent exact location and type); {@link
38 * System#loadLibrary} is called to load that library. If this loading
39 * succeeds, the function named {@code java_lang_Compiler_start()} in that
40 * library is called.
41 *
42 * <p> If no compiler is available, these methods do nothing.
43 *
44 * @author Frank Yellin
45 * @since 1.0
46 */
47 public final class Compiler {
48 private Compiler() {} // don't make instances
49
50 private static native void initialize();
51
52 private static native void registerNatives();
53
54 static {
55 registerNatives();
56 java.security.AccessController.doPrivileged(
57 new java.security.PrivilegedAction<Void>() {
58 public Void run() {
59 boolean loaded = false;
60 String jit = System.getProperty("java.compiler");
61 if ((jit != null) && (!jit.equals("NONE")) &&
62 (!jit.equals("")))
63 {
64 try {
65 System.loadLibrary(jit);
|