com.sun.rtsjx
Class Compiler

java.lang.Object
  extended by com.sun.rtsjx.Compiler

public final class Compiler
extends java.lang.Object

The Compiler class is provided to support the Initialization Time Compilation (ITC for short) via application code. For a complete explanation of ITC, please refer to the Compilation Guide found in the Java RTS documentation.


Method Summary
static void mark(java.lang.ClassLoader loader, java.net.URL classList, java.net.URL methodList, boolean initialize)
          This method marks a set of methods that must be compiled at the time the class that declares them is initialized.
static void preinit(java.lang.ClassLoader loader, java.net.URL classList)
          This method triggers the pre-initialization of a set of classes specified via an URL.
static void preload(java.lang.ClassLoader loader, java.net.URL classList)
          This method triggers the pre-loading of a set of classes specified via an URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

preload

public static void preload(java.lang.ClassLoader loader,
                           java.net.URL classList)
This method triggers the pre-loading of a set of classes specified via an URL. The format of the class list found at the specified URL is the same as the format described in the Compilation Guide Calling this method will pre-load,through the specified class loader, all the classes found in the specified list. Any error encountered while loading a class is ignored in that the list is processed up to the end. An error can be due to a class not being found for instance or to a class with an erroneous format. Whenever an error is encountered, a warning is printed out by the VM (depending on the value of the PrintITCWarnings command line option).

Parameters:
loader - The class loader where the classes should be loaded. When this parameter is null, the default application class loader is used.
classList - A URL where to find the list of classes that must be pre-loaded
Throws:
java.lang.IllegalArgumentException - if the classList URL is invalid.

preinit

public static void preinit(java.lang.ClassLoader loader,
                           java.net.URL classList)
This method triggers the pre-initialization of a set of classes specified via an URL. The format of the class list found at the specified URL is the same as the format described in the Compilation Guide This method first call the pre_load method with the same loader and list. Then all the classes in the list are pre-initialized. Any error encountered during pre-initialization will end up by throwing an ExceptionInInitializerError and thus by stopping the processing of the list. Any class which has already been initialized at the time such an error is thrown has all it's specified method compiled at the time the error is thrown.

Parameters:
loader - The class loader where the classes should be loaded. When this parameter is null, the default application class loader is used.
classList - A URL where to find the list of classes that must be preloaded
Throws:
java.lang.IllegalArgumentException - if the classList URL is invalid.
java.lang.ExceptionInInitializerError - if an exception is encountered while initializing a class in the list

mark

public static void mark(java.lang.ClassLoader loader,
                        java.net.URL classList,
                        java.net.URL methodList,
                        boolean initialize)
This method marks a set of methods that must be compiled at the time the class that declares them is initialized. The set of methods is specified via a list found at the specified URL (methodList). The set of classes that is passed as a parameter is used to specify a set of classes that must be preloaded and/or pre-initialized for the compilation to produce jitter-free code. This set of classes may differ from the set of classes that contain a method listed in methodList. The format of the class and method lists found at the specified URLs are the same as the format described in the Compilation Guide If the boolean initialization parameter is true then the classes specified in the classList parameter are pre-initialized before the call to the mark method returns.

Parameters:
loader - The class loader where the classes should be loaded. When this parameter is null, the default application class loader is used.
classList - A URL where to find the class list
methodList - A URL where to find the list of method that must be marked.
initialize - Determines whether the set of classes in classList must be pre-initialized before the call to mark returns.
Throws:
java.lang.IllegalArgumentException - if the classList URL or the methodList URL are invalid.