use of org.graalvm.compiler.hotspot.nodes.StubStartNode in project graal by oracle.
the class Stub method buildCompilationResult.
@SuppressWarnings("try")
private CompilationResult buildCompilationResult(DebugContext debug, final Backend backend) {
CompilationIdentifier compilationId = getStubCompilationId();
final StructuredGraph graph = getGraph(debug, compilationId);
CompilationResult compResult = new CompilationResult(compilationId, toString(), GeneratePIC.getValue(options));
// Stubs cannot be recompiled so they cannot be compiled with assumptions
assert graph.getAssumptions() == null;
if (!(graph.start() instanceof StubStartNode)) {
StubStartNode newStart = graph.add(new StubStartNode(Stub.this));
newStart.setStateAfter(graph.start().stateAfter());
graph.replaceFixed(graph.start(), newStart);
}
try (DebugContext.Scope s0 = debug.scope("StubCompilation", graph, providers.getCodeCache())) {
Suites suites = createSuites();
emitFrontEnd(providers, backend, graph, providers.getSuites().getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL, DefaultProfilingInfo.get(TriState.UNKNOWN), suites);
LIRSuites lirSuites = createLIRSuites();
emitBackEnd(graph, Stub.this, getInstalledCodeOwner(), backend, compResult, CompilationResultBuilderFactory.Default, getRegisterConfig(), lirSuites);
assert checkStubInvariants(compResult);
} catch (Throwable e) {
throw debug.handle(e);
}
return compResult;
}
Aggregations