diff graal/GraalCompiler/src/com/sun/c1x/graph/IR.java @ 2602:0c6564c254af

new node layout: BlockBegin, BlockEnd -Dc1x.dot=regex for pdf output escape dot graph labels (<, >, &)
author Lukas Stadler <lukas.stadler@jku.at>
date Fri, 06 May 2011 10:25:37 +0200
parents fec99fc30af1
children 3558ca7088c0
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java	Thu May 05 16:33:12 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java	Fri May 06 10:25:37 2011 +0200
@@ -24,6 +24,7 @@
 
 import java.util.*;
 
+import com.oracle.graal.graph.*;
 import com.sun.c1x.*;
 import com.sun.c1x.debug.*;
 import com.sun.c1x.ir.*;
@@ -61,6 +62,8 @@
      */
     private List<BlockBegin> orderedBlocks;
 
+    private final Graph graph = new Graph();
+
     /**
      * Creates a new IR instance for the specified compilation.
      * @param compilation the compilation
@@ -93,7 +96,7 @@
 
     private void buildGraph() {
         // Graph builder must set the startBlock and the osrEntryBlock
-        new GraphBuilder(compilation, this).build();
+        new GraphBuilder(compilation, this, graph).build();
         assert startBlock != null;
         verifyAndPrint("After graph building");
 
@@ -173,12 +176,12 @@
         }
 
         // create new successor and mark it for special block order treatment
-        BlockBegin newSucc = new BlockBegin(bci, nextBlockNumber());
+        BlockBegin newSucc = new BlockBegin(bci, nextBlockNumber(), graph);
 
         newSucc.setCriticalEdgeSplit(true);
 
         // This goto is not a safepoint.
-        Goto e = new Goto(target, null, false);
+        Goto e = new Goto(target, null, false, graph);
         newSucc.appendNext(e, bci);
         newSucc.setEnd(e);
         // setup states
@@ -226,8 +229,8 @@
             newBlock.addPredecessor(pred);
         }
         // this block is now disconnected; remove all its incoming and outgoing edges
-        oldBlock.blockPredecessors().clear();
-        oldBlock.end().blockSuccessors().clear();
+//        oldBlock.blockPredecessors().clear();
+//        oldBlock.end().blockSuccessors().clear();
     }
 
     /**
@@ -273,4 +276,8 @@
     public final int maxLocks() {
         return maxLocks;
     }
+
+    public Graph graph() {
+        return graph;
+    }
 }