changeset 17071:1b7b4eb6e0ef

Enable scheduling when dumping for DumpOnError
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Tue, 09 Sep 2014 11:51:59 +0200
parents 6e45ae59781c
children e4923262b8c5
files graal/com.oracle.graal.printer/src/com/oracle/graal/printer/BinaryGraphPrinter.java
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/BinaryGraphPrinter.java	Tue Sep 09 11:37:57 2014 +0200
+++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/BinaryGraphPrinter.java	Tue Sep 09 11:51:59 2014 +0200
@@ -33,6 +33,7 @@
 
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.compiler.common.cfg.*;
+import com.oracle.graal.debug.*;
 import com.oracle.graal.graph.*;
 import com.oracle.graal.nodes.*;
 import com.oracle.graal.nodes.cfg.*;
@@ -128,7 +129,8 @@
     private void writeGraph(Graph graph, SchedulePhase predefinedSchedule) throws IOException {
         SchedulePhase schedule = predefinedSchedule;
         if (schedule == null) {
-            if (PrintIdealGraphSchedule.getValue()) {
+            // Also provide a schedule when an error occurs
+            if (PrintIdealGraphSchedule.getValue() || Debug.contextLookup(Throwable.class) != null) {
                 try {
                     schedule = new SchedulePhase();
                     schedule.apply((StructuredGraph) graph);