diff graal/GraalCompiler/src/com/sun/c1x/ir/BlockBegin.java @ 2756:bfcdda4fdd73

Removed the direct connection between BlockBegin and BlockEnd.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Fri, 20 May 2011 14:51:45 +0200
parents 0d268cf66e24
children b72e6638b9e6
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/BlockBegin.java	Fri May 20 14:34:36 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/ir/BlockBegin.java	Fri May 20 14:51:45 2011 +0200
@@ -41,8 +41,7 @@
     private static final int INPUT_COUNT = 1;
     private static final int INPUT_STATE_BEFORE = 0;
 
-    private static final int SUCCESSOR_COUNT = 1;
-    private static final int SUCCESSOR_END = 0;
+    private static final int SUCCESSOR_COUNT = 0;
 
     @Override
     protected int inputCount() {
@@ -58,7 +57,11 @@
      * The last node in the block (which contains the successors).
      */
     public BlockEnd end() {
-        return (BlockEnd) successors().get(super.successorCount() + SUCCESSOR_END);
+        Instruction next = next();
+        while (!(next instanceof BlockEnd)) {
+            next = next.next();
+        }
+        return (BlockEnd) next;
     }
 
     @Override
@@ -66,11 +69,6 @@
         return false;
     }
 
-    public void setEnd(BlockEnd end) {
-        assert end != null;
-        successors().set(super.successorCount() + SUCCESSOR_END, end);
-    }
-
     /**
      * A unique id used in tracing.
      */