diff graal/GraalCompiler/src/com/sun/c1x/ir/BlockEnd.java @ 2616:3558ca7088c0

FrameState and Graphviz changes: * removed popx, pushx methods from GraphBuilder * FrameState subclass of Value * added String shortName() to Node * added GraphvizPrinter option to use short names * small hack in GraphvizPrinter: omit FrameState->Local connections * added GraalGraphviz to implicit classpatch (read from GRAAL env var)
author Lukas Stadler <lukas.stadler@jku.at>
date Mon, 09 May 2011 17:00:25 +0200
parents 0c6564c254af
children dd115f80acf8
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/BlockEnd.java	Mon May 09 14:11:13 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/ir/BlockEnd.java	Mon May 09 17:00:25 2011 +0200
@@ -34,7 +34,8 @@
  */
 public abstract class BlockEnd extends Instruction {
 
-    private static final int INPUT_COUNT = 0;
+    private static final int INPUT_COUNT = 1;
+    private static final int INPUT_STATE_AFTER = 0;
 
     private final int blockSuccessorCount;
 
@@ -49,6 +50,17 @@
     }
 
     /**
+     * The state for this instruction.
+     */
+     @Override
+    public FrameState stateAfter() {
+        return (FrameState) inputs().get(super.inputCount() + INPUT_STATE_AFTER);
+    }
+
+    public FrameState setStateAfter(FrameState n) {
+        return (FrameState) inputs().set(super.inputCount() + INPUT_STATE_AFTER, n);
+    }
+    /**
      * The list of instructions that produce input for this instruction.
      */
     public BlockBegin blockSuccessor(int index) {
@@ -66,7 +78,6 @@
     }
 
     BlockBegin begin;
-    FrameState stateAfter;
     boolean isSafepoint;
 
     /**
@@ -95,18 +106,6 @@
     }
 
     /**
-     * Gets the state after the end of this block.
-     */
-    @Override
-    public FrameState stateAfter() {
-        return stateAfter;
-    }
-
-    public void setStateAfter(FrameState state) {
-        stateAfter = state;
-    }
-
-    /**
      * Checks whether this instruction is a safepoint.
      * @return {@code true} if this instruction is a safepoint
      */