Search in sources :

Example 1 with VerifyFrameDoesNotEscapePhase

use of org.graalvm.compiler.truffle.compiler.phases.VerifyFrameDoesNotEscapePhase in project graal by oracle.

the class PartialEvaluator method createGraph.

@SuppressWarnings("try")
public StructuredGraph createGraph(DebugContext debug, final CompilableTruffleAST compilable, TruffleInliningPlan inliningPlan, AllowAssumptions allowAssumptions, CompilationIdentifier compilationId, SpeculationLog log, Cancellable cancellable) {
    String name = compilable.toString();
    OptionValues options = TruffleCompilerOptions.getOptions();
    ResolvedJavaMethod rootMethod = rootForCallTarget(compilable);
    // @formatter:off
    final StructuredGraph graph = new StructuredGraph.Builder(options, debug, allowAssumptions).name(name).method(rootMethod).speculationLog(log).compilationId(compilationId).cancellable(cancellable).build();
    try (DebugContext.Scope s = debug.scope("CreateGraph", graph);
        Indent indent = debug.logAndIndent("createGraph %s", graph)) {
        PhaseContext baseContext = new PhaseContext(providers);
        HighTierContext tierContext = new HighTierContext(providers, new PhaseSuite<HighTierContext>(), OptimisticOptimizations.NONE);
        fastPartialEvaluation(compilable, inliningPlan, graph, baseContext, tierContext);
        if (cancellable != null && cancellable.isCancelled()) {
            return null;
        }
        new VerifyFrameDoesNotEscapePhase().apply(graph, false);
        postPartialEvaluation(graph);
    } catch (Throwable e) {
        throw debug.handle(e);
    }
    return graph;
}
Also used : Indent(org.graalvm.compiler.debug.Indent) VerifyFrameDoesNotEscapePhase(org.graalvm.compiler.truffle.compiler.phases.VerifyFrameDoesNotEscapePhase) OptionValues(org.graalvm.compiler.options.OptionValues) DebugContext(org.graalvm.compiler.debug.DebugContext) PhaseContext(org.graalvm.compiler.phases.tiers.PhaseContext) StructuredGraph(org.graalvm.compiler.nodes.StructuredGraph) HighTierContext(org.graalvm.compiler.phases.tiers.HighTierContext) ResolvedJavaMethod(jdk.vm.ci.meta.ResolvedJavaMethod)

Aggregations

ResolvedJavaMethod (jdk.vm.ci.meta.ResolvedJavaMethod)1 DebugContext (org.graalvm.compiler.debug.DebugContext)1 Indent (org.graalvm.compiler.debug.Indent)1 StructuredGraph (org.graalvm.compiler.nodes.StructuredGraph)1 OptionValues (org.graalvm.compiler.options.OptionValues)1 HighTierContext (org.graalvm.compiler.phases.tiers.HighTierContext)1 PhaseContext (org.graalvm.compiler.phases.tiers.PhaseContext)1 VerifyFrameDoesNotEscapePhase (org.graalvm.compiler.truffle.compiler.phases.VerifyFrameDoesNotEscapePhase)1