Skip to content

Commit d864062

Browse files
committed
Fix schedule computation in GraphPrinter#getScheduleOrNull
1 parent 9d0dd2b commit d864062

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/printer/GraphPrinter.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -242,16 +242,14 @@ static String constantArrayToString(Object array, Set<Object> visited) {
242242

243243
@SuppressWarnings("try")
244244
static StructuredGraph.ScheduleResult getScheduleOrNull(Graph graph) {
245-
if (graph instanceof StructuredGraph) {
246-
StructuredGraph sgraph = (StructuredGraph) graph;
247-
StructuredGraph.ScheduleResult scheduleResult = sgraph.getLastSchedule();
248-
if (scheduleResult == null) {
249-
DebugContext debug = graph.getDebug();
250-
try (Scope scope = debug.disable()) {
251-
SchedulePhase.runWithoutContextOptimizations(sgraph);
252-
scheduleResult = sgraph.getLastSchedule();
253-
} catch (Throwable t) {
254-
}
245+
if (graph instanceof StructuredGraph sgraph) {
246+
DebugContext debug = graph.getDebug();
247+
StructuredGraph.ScheduleResult scheduleResult;
248+
try (Scope scope = debug.disable()) {
249+
SchedulePhase.runWithoutContextOptimizations(sgraph);
250+
scheduleResult = sgraph.getLastSchedule();
251+
} catch (Throwable t) {
252+
scheduleResult = null;
255253
}
256254
return scheduleResult;
257255
}

0 commit comments

Comments
 (0)