diff graal/GraalCompiler/src/com/sun/c1x/ir/Throw.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 91d3952f7eb7
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/Throw.java	Mon May 09 14:11:13 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/ir/Throw.java	Mon May 09 17:00:25 2011 +0200
@@ -32,8 +32,9 @@
  */
 public final class Throw extends BlockEnd {
 
-    private static final int INPUT_COUNT = 1;
+    private static final int INPUT_COUNT = 2;
     private static final int INPUT_EXCEPTION = 0;
+    private static final int INPUT_STATE_BEFORE = 1;
 
     private static final int SUCCESSOR_COUNT = 0;
 
@@ -58,7 +59,17 @@
         return (Value) inputs().set(super.inputCount() + INPUT_EXCEPTION, n);
     }
 
-    FrameState stateBefore;
+    /**
+     * The state before this throw would occur.
+     */
+     @Override
+    public FrameState stateBefore() {
+        return (FrameState) inputs().get(super.inputCount() + INPUT_STATE_BEFORE);
+    }
+
+    private FrameState setStateBefore(FrameState n) {
+        return (FrameState) inputs().set(super.inputCount() + INPUT_STATE_BEFORE, n);
+    }
 
     /**
      * Creates a new Throw instruction.
@@ -69,20 +80,11 @@
      */
     public Throw(Value exception, FrameState stateAfter, boolean isSafepoint, Graph graph) {
         super(CiKind.Illegal, null, isSafepoint, 0, INPUT_COUNT, SUCCESSOR_COUNT, graph);
-        this.stateBefore = stateAfter;
+        setStateBefore(stateAfter);
         setException(exception);
     }
 
     /**
-     * Returns the state before this throw would occur.
-     * @return the state before the throw
-     */
-    @Override
-    public FrameState stateBefore() {
-        return stateBefore;
-    }
-
-    /**
      * Checks whether this instruction can trap.
      * @return {@code true} because this instruction definitely throws an exception!
      */