src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/BinaryGraphPrinter.java
changeset 57537 ecc6e394475f
parent 54724 62f373a53296
child 58299 6df94ce3ab2f
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/BinaryGraphPrinter.java	Thu Jul 25 11:44:37 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/BinaryGraphPrinter.java	Thu Jul 25 17:35:58 2019 -0400
@@ -42,7 +42,6 @@
 import org.graalvm.compiler.bytecode.Bytecode;
 import org.graalvm.compiler.core.common.cfg.BlockMap;
 import org.graalvm.compiler.debug.DebugContext;
-import org.graalvm.compiler.debug.DebugOptions;
 import org.graalvm.compiler.graph.CachedGraph;
 import org.graalvm.compiler.graph.Edges;
 import org.graalvm.compiler.graph.Graph;
@@ -66,7 +65,6 @@
 import org.graalvm.compiler.nodes.cfg.Block;
 import org.graalvm.compiler.nodes.cfg.ControlFlowGraph;
 import org.graalvm.compiler.nodes.util.JavaConstantFormattable;
-import org.graalvm.compiler.phases.schedule.SchedulePhase;
 import org.graalvm.graphio.GraphBlocks;
 import org.graalvm.graphio.GraphElements;
 import org.graalvm.graphio.GraphLocations;
@@ -591,22 +589,8 @@
             this.graph = graph;
             StructuredGraph.ScheduleResult scheduleResult = null;
             if (graph instanceof StructuredGraph) {
-
                 StructuredGraph structuredGraph = (StructuredGraph) graph;
-                scheduleResult = structuredGraph.getLastSchedule();
-                if (scheduleResult == null) {
-
-                    // Also provide a schedule when an error occurs
-                    if (DebugOptions.PrintGraphWithSchedule.getValue(graph.getOptions()) || debug.contextLookup(Throwable.class) != null) {
-                        try {
-                            SchedulePhase schedule = new SchedulePhase(graph.getOptions());
-                            schedule.apply(structuredGraph);
-                            scheduleResult = structuredGraph.getLastSchedule();
-                        } catch (Throwable t) {
-                        }
-                    }
-
-                }
+                scheduleResult = GraalDebugHandlersFactory.tryGetSchedule(debug, structuredGraph);
             }
             cfg = scheduleResult == null ? debug.contextLookup(ControlFlowGraph.class) : scheduleResult.getCFG();
             blockToNodes = scheduleResult == null ? null : scheduleResult.getBlockToNodesMap();