Search in sources :

Example 1 with Request

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);
    }
}
Also used : StructuredGraph(org.graalvm.compiler.nodes.StructuredGraph) Request(org.graalvm.compiler.core.GraalCompiler.Request) DebugContext(org.graalvm.compiler.debug.DebugContext) CompilationResult(org.graalvm.compiler.code.CompilationResult)

Aggregations

CompilationResult (org.graalvm.compiler.code.CompilationResult)1 Request (org.graalvm.compiler.core.GraalCompiler.Request)1 DebugContext (org.graalvm.compiler.debug.DebugContext)1 StructuredGraph (org.graalvm.compiler.nodes.StructuredGraph)1