changeset 17108:dbb08e742d87

Add optional graph dump before each compiler phase.
author Roland Schatz <roland.schatz@oracle.com>
date Mon, 15 Sep 2014 17:16:53 +0200
parents 33d2fea5d40e
children 881fa8b6ca9d
files graal/com.oracle.graal.phases/src/com/oracle/graal/phases/BasePhase.java
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/BasePhase.java	Fri Sep 12 15:39:45 2014 -0700
+++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/BasePhase.java	Mon Sep 15 17:16:53 2014 +0200
@@ -39,6 +39,7 @@
 public abstract class BasePhase<C> {
 
     public static final int PHASE_DUMP_LEVEL = 1;
+    public static final int BEFORE_PHASE_DUMP_LEVEL = 3;
 
     private CharSequence name;
 
@@ -96,6 +97,9 @@
 
     public final void apply(final StructuredGraph graph, final C context, final boolean dumpGraph) {
         try (TimerCloseable a = timer.start(); Scope s = Debug.scope(getClass(), this); Closeable c = memUseTracker.start()) {
+            if (dumpGraph && Debug.isDumpEnabled(BEFORE_PHASE_DUMP_LEVEL)) {
+                Debug.dump(BEFORE_PHASE_DUMP_LEVEL, graph, "Before phase %s", getName());
+            }
             this.run(graph, context);
             executionCount.increment();
             inputNodesCount.add(graph.getNodeCount());