use of org.jikesrvm.compilers.opt.OptimizingCompilerException in project JikesRVM by JikesRVM.
the class OptimizingCompiler method init.
// //////////////////////////////////////////
// Initialization
// //////////////////////////////////////////
/**
* Prepare compiler for use.
* @param options options to use for compilations during initialization
*/
public static void init(OptOptions options) {
try {
if (!(VM.writingBootImage || VM.runningTool || VM.runningVM)) {
// Caller failed to ensure that the VM was initialized.
throw new OptimizingCompilerException("VM not initialized", true);
}
// Make a local copy so that some options can be forced off just for the
// duration of this initialization step.
options = options.dup();
options.ESCAPE_SIMPLE_IPA = false;
initializeStatics();
// want to be notified when VM boot is done and ready to start application
Callbacks.addStartupMonitor(new OptimizingCompiler());
isInitialized = true;
} catch (OptimizingCompilerException e) {
// failures during initialization can't be ignored
e.isFatal = true;
throw e;
} catch (Throwable e) {
OptimizingCompilerException oe = new OptimizingCompilerException("Compiler", "untrapped failure during init, " + " Converting to OptimizingCompilerException");
oe.initCause(e);
throw oe;
}
}
use of org.jikesrvm.compilers.opt.OptimizingCompilerException in project JikesRVM by JikesRVM.
the class OptimizingCompiler method compile.
// //////////////////////////////////////////
// Public interface for compiling a method
// //////////////////////////////////////////
/**
* Invoke the opt compiler to execute a compilation plan.
*
* @param cp the compilation plan to be executed
* @return the CompiledMethod object that is the result of compilation
*/
public static CompiledMethod compile(CompilationPlan cp) {
NormalMethod method = cp.method;
OptOptions options = cp.options;
checkSupported(method, options);
try {
printMethodMessage(method, options);
IR ir = cp.execute();
// if doing analysis only, don't try to return an object
if (cp.analyzeOnly || cp.irGeneration) {
return null;
}
// now that we're done compiling, give the specialization
// system a chance to eagerly compile any specialized version
// that are pending. TODO: use lazy compilation with specialization.
SpecializationDatabase.doDeferredSpecializations();
ir.compiledMethod.compileComplete(ir.MIRInfo.machinecode);
return ir.compiledMethod;
} catch (OptimizingCompilerException e) {
throw e;
} catch (Throwable e) {
fail(e, method);
return null;
}
}
Aggregations