# HG changeset patch # User Erik Eckstein # Date 1395825012 -3600 # Node ID 91c88fc2157c79a374fc9ee0f866909edcda1b48 # Parent 3e1e832871283537b6da321c4cb845dd465ff61c make scheduling in IdealGraphPrinter optional diff -r 3e1e83287128 -r 91c88fc2157c graal/com.oracle.graal.printer/src/com/oracle/graal/printer/GraphPrinterDumpHandler.java --- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/GraphPrinterDumpHandler.java Wed Mar 26 10:08:31 2014 +0100 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/GraphPrinterDumpHandler.java Wed Mar 26 10:10:12 2014 +0100 @@ -115,7 +115,7 @@ if (PrintBinaryGraphs.getValue()) { printer = new BinaryGraphPrinter(FileChannel.open(file.toPath(), StandardOpenOption.WRITE, StandardOpenOption.CREATE_NEW)); } else { - printer = new IdealGraphPrinter(new FileOutputStream(file)); + printer = new IdealGraphPrinter(new FileOutputStream(file), true); } TTY.println("Dumping IGV graphs to %s", file.getName()); } catch (IOException e) { @@ -132,7 +132,7 @@ if (PrintBinaryGraphs.getValue()) { printer = new BinaryGraphPrinter(SocketChannel.open(new InetSocketAddress(host, port))); } else { - IdealGraphPrinter xmlPrinter = new IdealGraphPrinter(new Socket(host, port).getOutputStream()); + IdealGraphPrinter xmlPrinter = new IdealGraphPrinter(new Socket(host, port).getOutputStream(), true); printer = xmlPrinter; } TTY.println("Connected to the IGV on %s:%d", host, port); diff -r 3e1e83287128 -r 91c88fc2157c graal/com.oracle.graal.printer/src/com/oracle/graal/printer/IdealGraphPrinter.java --- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/IdealGraphPrinter.java Wed Mar 26 10:08:31 2014 +0100 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/IdealGraphPrinter.java Wed Mar 26 10:10:12 2014 +0100 @@ -42,12 +42,18 @@ */ public class IdealGraphPrinter extends BasicIdealGraphPrinter implements GraphPrinter { + private final boolean tryToSchedule; + /** * Creates a new {@link IdealGraphPrinter} that writes to the specified output stream. + * + * @param tryToSchedule If false, no scheduling is done, which avoids exceptions for + * non-schedulable graphs. */ - public IdealGraphPrinter(OutputStream stream) { + public IdealGraphPrinter(OutputStream stream, boolean tryToSchedule) { super(stream); this.begin(); + this.tryToSchedule = tryToSchedule; } /** @@ -80,7 +86,7 @@ beginGraph(title); Set noBlockNodes = new HashSet<>(); SchedulePhase schedule = predefinedSchedule; - if (schedule == null) { + if (schedule == null && tryToSchedule) { try { schedule = new SchedulePhase(); schedule.apply((StructuredGraph) graph);