changeset 2895:5fd2b31f50ee

Schedule now inherits Phase.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 08 Jun 2011 14:17:19 +0200
parents d9ee2a573a55
children 5d4aa5672d3d
files graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/IdealGraphPrinter.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graph/IR.java graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/schedule/Schedule.java
diffstat 3 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/IdealGraphPrinter.java	Wed Jun 08 14:10:06 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/IdealGraphPrinter.java	Wed Jun 08 14:17:19 2011 +0200
@@ -114,7 +114,8 @@
 
         Schedule schedule = null;
         try {
-            schedule = new Schedule(graph);
+            schedule = new Schedule();
+            schedule.apply(graph);
         } catch (Throwable t) {
             // nothing to do here...
         }
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graph/IR.java	Wed Jun 08 14:10:06 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graph/IR.java	Wed Jun 08 14:17:19 2011 +0200
@@ -93,7 +93,8 @@
 
         new SplitCriticalEdgesPhase().apply(graph);
 
-        Schedule schedule = new Schedule(graph);
+        Schedule schedule = new Schedule();
+        schedule.apply(graph);
         List<Block> blocks = schedule.getBlocks();
         List<LIRBlock> lirBlocks = new ArrayList<LIRBlock>();
         Map<Block, LIRBlock> map = new HashMap<Block, LIRBlock>();
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/schedule/Schedule.java	Wed Jun 08 14:10:06 2011 +0200
+++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/schedule/Schedule.java	Wed Jun 08 14:17:19 2011 +0200
@@ -31,16 +31,19 @@
 import com.sun.cri.ci.*;
 
 
-public class Schedule {
+public class Schedule extends Phase {
     private final List<Block> blocks = new ArrayList<Block>();
-    private final NodeMap<Block> nodeToBlock;
-    private final Graph graph;
+    private NodeMap<Block> nodeToBlock;
+    private Graph graph;
 
-    public Schedule(Graph graph) {
+
+    @Override
+    protected void run(Graph graph) {
         this.graph = graph;
         nodeToBlock = graph.createNodeMap();
         identifyBlocks();
     }
+
     public List<Block> getBlocks() {
         return Collections.unmodifiableList(blocks);
     }