use of org.graalvm.compiler.core.GraalCompiler.Request in project graal by oracle.
the class GraalCompilerTest method compile.
/**
* Compiles a given method.
*
* @param installedCodeOwner the method the compiled code will be associated with when installed
* @param graph the graph to be compiled for {@code installedCodeOwner}. If null, a graph will
* be obtained from {@code installedCodeOwner} via
* {@link #parseForCompile(ResolvedJavaMethod)}.
* @param compilationId
*/
@SuppressWarnings("try")
protected CompilationResult compile(ResolvedJavaMethod installedCodeOwner, StructuredGraph graph, CompilationResult compilationResult, CompilationIdentifier compilationId, OptionValues options) {
StructuredGraph graphToCompile = graph == null ? parseForCompile(installedCodeOwner, compilationId, options) : graph;
lastCompiledGraph = graphToCompile;
DebugContext debug = graphToCompile.getDebug();
try (DebugContext.Scope s = debug.scope("Compile", graphToCompile)) {
assert options != null;
Request<CompilationResult> request = new Request<>(graphToCompile, installedCodeOwner, getProviders(), getBackend(), getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL, graphToCompile.getProfilingInfo(), createSuites(options), createLIRSuites(options), compilationResult, CompilationResultBuilderFactory.Default);
return GraalCompiler.compile(request);
} catch (Throwable e) {
throw debug.handle(e);
}
}
Aggregations