src/java.base/share/classes/java/lang/Compiler.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 45,88 **** * @since 1.0 */ public final class Compiler { private Compiler() {} // don't make instances - private static native void initialize(); - - private static native void registerNatives(); - - static { - registerNatives(); - java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction<Void>() { - public Void run() { - boolean loaded = false; - String jit = System.getProperty("java.compiler"); - if ((jit != null) && (!jit.equals("NONE")) && - (!jit.equals(""))) - { - try { - System.loadLibrary(jit); - initialize(); - loaded = true; - } catch (UnsatisfiedLinkError e) { - System.err.println("Warning: JIT compiler \"" + - jit + "\" not found. Will use interpreter."); - } - } - String info = System.getProperty("java.vm.info"); - if (loaded) { - System.setProperty("java.vm.info", info + ", " + jit); - } else { - System.setProperty("java.vm.info", info + ", nojit"); - } - return null; - } - }); - } - /** * Compiles the specified class. * * @param clazz * A class --- 45,54 ----
*** 91,101 **** * compilation failed or no compiler is available * * @throws NullPointerException * If {@code clazz} is {@code null} */ ! public static native boolean compileClass(Class<?> clazz); /** * Compiles all classes whose name matches the specified string. * * @param string --- 57,69 ---- * compilation failed or no compiler is available * * @throws NullPointerException * If {@code clazz} is {@code null} */ ! public static boolean compileClass(Class<?> clazz) { ! return false; ! } /** * Compiles all classes whose name matches the specified string. * * @param string
*** 105,115 **** * compilation failed or no compiler is available * * @throws NullPointerException * If {@code string} is {@code null} */ ! public static native boolean compileClasses(String string); /** * Examines the argument type and its fields and perform some documented * operation. No specific operations are required. * --- 73,85 ---- * compilation failed or no compiler is available * * @throws NullPointerException * If {@code string} is {@code null} */ ! public static boolean compileClasses(String string) { ! return false; ! } /** * Examines the argument type and its fields and perform some documented * operation. No specific operations are required. *
*** 120,136 **** * available * * @throws NullPointerException * If {@code any} is {@code null} */ ! public static native Object command(Object any); /** * Cause the Compiler to resume operation. */ ! public static native void enable(); /** * Cause the Compiler to cease operation. */ ! public static native void disable(); } --- 90,108 ---- * available * * @throws NullPointerException * If {@code any} is {@code null} */ ! public static Object command(Object any) { ! return null; ! } /** * Cause the Compiler to resume operation. */ ! public static void enable() { } /** * Cause the Compiler to cease operation. */ ! public static void disable() { } }