use of com.oracle.svm.core.graal.code.SubstrateCompilationResult in project graal by oracle.
the class SubstrateGraalUtils method compileGraph.
@SuppressWarnings("try")
public static CompilationResult compileGraph(RuntimeConfiguration runtimeConfig, Suites suites, LIRSuites lirSuites, final SharedMethod method, final StructuredGraph graph) {
assert runtimeConfig != null : "no runtime";
if (Options.ForceDumpGraphsBeforeCompilation.getValue()) {
/*
* forceDump is often used during debugging, and we want to make sure that it keeps
* working, i.e., does not lead to image generation problems when adding a call to it.
* This code ensures that forceDump is seen as reachable for all images that include
* Graal, because it is conditional on a runtime option.
*/
graph.getDebug().forceDump(graph, "Force dump before compilation");
}
String methodName = method.format("%h.%n");
try (DebugContext debug = graph.getDebug();
Indent indent = debug.logAndIndent("compile graph %s for method %s", graph, methodName)) {
OptimisticOptimizations optimisticOpts = OptimisticOptimizations.ALL.remove(OptimisticOptimizations.Optimization.UseLoopLimitChecks);
final Backend backend = runtimeConfig.lookupBackend(method);
try (Indent indent2 = debug.logAndIndent("do compilation")) {
SubstrateCompilationResult result = new SubstrateCompilationResult(graph.compilationId(), method.format("%H.%n(%p)"));
GraalCompiler.compileGraph(graph, method, backend.getProviders(), backend, null, optimisticOpts, null, suites, lirSuites, result, CompilationResultBuilderFactory.Default);
return result;
}
}
}
Aggregations