public final class OptimizingCompiler extends Object implements Callbacks.StartupMonitor
The main driver of the Compiler.
External drivers are responsible for providing the policies; the role of this class is simply to take a CompilationPlan and execute it.
Currently, this class is invoked from four clients:
Clients are responsible for ensuring that:
This class is not meant to be instantiated.
Modifier and Type | Field and Description |
---|---|
private static boolean |
appStarted
indicate when the application has started
|
private static boolean |
isInitialized
Has the optimizing compiler been initialized?
|
Modifier | Constructor and Description |
---|---|
private |
OptimizingCompiler()
Prevent instantiation by clients
|
Modifier and Type | Method and Description |
---|---|
static void |
bottom(String what,
NormalMethod method)
Debugging aid to be called after printing the IR
|
private static void |
checkSupported(NormalMethod method,
OptOptions options)
Checks whether opt compilation of a particular method is supported.
|
static CompiledMethod |
compile(CompilationPlan cp)
Invoke the opt compiler to execute a compilation plan.
|
private static void |
fail(Throwable e,
NormalMethod method)
Abort a compilation with an error.
|
static boolean |
getAppStarted() |
static void |
header(String what,
NormalMethod method)
Debugging aid to be called before printing the IR
|
static void |
init(OptOptions options)
Prepare compiler for use.
|
private static void |
initializeStatics()
Call the static init functions for the Compiler subsystems
|
static boolean |
isInitialized() |
void |
notifyStartup()
Notify the monitor that the VM has started up.
|
static void |
printInstructions(IR ir,
String message)
Prints the IR along with a message.
|
private static void |
printMethodMessage(NormalMethod method,
OptOptions options)
Prints a message of a method name.
|
static void |
report(String what)
Debugging aid.
|
static void |
report(String what,
long time)
Debugging aid.
|
(package private) static void |
reset()
Reset the optimizing compiler
|
static void |
setAppStarted() |
static void |
setBootOptions(OptOptions options)
Set up option used while compiling the boot image
|
private static boolean appStarted
private static boolean isInitialized
private OptimizingCompiler()
public static void init(OptOptions options)
options
- options to use for compilations during initializationpublic void notifyStartup()
Callbacks.StartupMonitor
notifyStartup
in interface Callbacks.StartupMonitor
public static boolean getAppStarted()
public static void setAppStarted()
public static void setBootOptions(OptOptions options)
options
- the options to setprivate static void initializeStatics()
public static boolean isInitialized()
static void reset()
public static CompiledMethod compile(CompilationPlan cp)
cp
- the compilation plan to be executedpublic static void report(String what)
what
- a string message to printpublic static void report(String what, long time)
what
- a string message to printtime
- a timestamp to printpublic static void header(String what, NormalMethod method)
what
- a string message to printmethod
- the method being compiledpublic static void bottom(String what, NormalMethod method)
what
- a string message to printmethod
- the method being compiledpublic static void printInstructions(IR ir, String message)
ir
- the IR to printmessage
- the message to printprivate static void printMethodMessage(NormalMethod method, OptOptions options)
method
- the method to printoptions
- the print options for the optimizing compilerprivate static void fail(Throwable e, NormalMethod method)
e
- The exception thrown by a compiler phasemethod
- The method being compiledprivate static void checkSupported(NormalMethod method, OptOptions options)
method
- the method to checkoptions
- options for printing