diff graal/GraalCompiler/src/com/sun/c1x/ir/BlockList.java @ 2793:d3fc4fe063bf

Rename BlockBegin to Merge, remove some Block related member from it. Made CFGPrinter work with the Block class from schedule
author Gilles Duboscq <gilles.duboscq@oracle.com>
date Fri, 27 May 2011 11:08:55 +0200
parents 4a6518c4d17d
children
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/BlockList.java	Thu May 26 11:55:16 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/ir/BlockList.java	Fri May 27 11:08:55 2011 +0200
@@ -28,16 +28,16 @@
  * The {@code BlockList} class implements a specialized list data structure for representing
  * the predecessor and successor lists of basic blocks.
  */
-public class BlockList implements Iterable<BlockBegin> {
+public class BlockList implements Iterable<Merge> {
 
-    private BlockBegin[] array;
+    private Merge[] array;
     private int cursor;
 
     BlockList(int sizeHint) {
         if (sizeHint > 0) {
-            array = new BlockBegin[sizeHint];
+            array = new Merge[sizeHint];
         } else {
-            array = new BlockBegin[2];
+            array = new Merge[2];
         }
     }
 
@@ -51,7 +51,7 @@
         cursor--;
     }
 
-    public void remove(BlockBegin block) {
+    public void remove(Merge block) {
         int j = 0;
         for (int i = 0; i < cursor; i++) {
             if (i != j) {
@@ -71,12 +71,12 @@
         if (index2 < 0 || index2 >= cursor) {
             throw new IndexOutOfBoundsException();
         }
-        BlockBegin t = array[index2];
+        Merge t = array[index2];
         array[index2] = array[index1];
         array[index1] = t;
     }
 
-    public void insert(int index, BlockBegin block) {
+    public void insert(int index, Merge block) {
         if (index < 0 || index >= cursor) {
             throw new IndexOutOfBoundsException();
         }
@@ -87,19 +87,19 @@
         array[cursor++] = block;
     }
 
-    public void append(BlockBegin block) {
+    public void append(Merge block) {
         growOne();
         array[cursor++] = block;
     }
 
-    public BlockBegin get(int index) {
+    public Merge get(int index) {
         if (index < 0 || index >= cursor) {
             throw new IndexOutOfBoundsException();
         }
         return array[index];
     }
 
-    public void replace(BlockBegin oldBlock, BlockBegin newBlock) {
+    public void replace(Merge oldBlock, Merge newBlock) {
         for (int i = 0; i < cursor; i++) {
             if (array[i] == oldBlock) {
                 array[i] = newBlock;
@@ -111,7 +111,7 @@
         if (cursor == 0) {
             return true;
         }
-        BlockBegin b = array[0];
+        Merge b = array[0];
         for (int i = 1; i < cursor; i++) {
             if (array[i] != b) {
                 return false;
@@ -120,7 +120,7 @@
         return true;
     }
 
-    public Iterator<BlockBegin> iterator() {
+    public Iterator<Merge> iterator() {
         return new Iter();
     }
 
@@ -130,14 +130,14 @@
         }
     }
 
-    private class Iter implements Iterator<BlockBegin> {
+    private class Iter implements Iterator<Merge> {
         private int pos;
 
         public boolean hasNext() {
             return pos < cursor;
         }
 
-        public BlockBegin next() {
+        public Merge next() {
             return array[pos++];
         }