use of org.graalvm.compiler.graph.Graph.NodeEventScope in project graal by oracle.
the class BasePhase method shouldDump.
@SuppressWarnings("try")
private boolean shouldDump(StructuredGraph graph, C context) {
DebugContext debug = graph.getDebug();
String phaseChange = DebugOptions.DumpOnPhaseChange.getValue(graph.getOptions());
if (phaseChange != null && Pattern.matches(phaseChange, getClass().getSimpleName())) {
StructuredGraph graphCopy = (StructuredGraph) graph.copy(graph.getDebug());
GraphChangeListener listener = new GraphChangeListener(graphCopy);
try (NodeEventScope s = graphCopy.trackNodeEvents(listener)) {
try (DebugContext.Scope s2 = debug.sandbox("GraphChangeListener", null)) {
run(graphCopy, context);
} catch (Throwable t) {
debug.handle(t);
}
}
return listener.changed;
}
return false;
}
Aggregations