diff graal/GraalCompiler/src/com/sun/c1x/ir/StateSplit.java @ 2707:7ed72769d51a

exception handling related changes: * changed blockPredecessors to list of Instructions, instead of Blocks * removed explicit predecessor management in BlockBegin, now using predecessors from Graph structure * replaced generated LIR exception entries with exception dispatch chains in IR * added Unwind and ExceptionDispatch instructions * removed ExceptionEntry flag in BlockBegin and all code depending on it * removed exceptionHandler list from Instruction, replaced by exception Edge on Invoke and Throw * replaced list of ExceptionHandlers with single exception edge in debug info misc: * changed GraphvizPrinter layout (smaller ports on large nodes) * removed defunct run config
author Lukas Stadler <lukas.stadler@jku.at>
date Wed, 18 May 2011 18:09:20 +0200
parents 440ceca8e3d7
children 027adfafd47e
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/StateSplit.java	Fri May 13 17:09:20 2011 -0700
+++ b/graal/GraalCompiler/src/com/sun/c1x/ir/StateSplit.java	Wed May 18 18:09:20 2011 +0200
@@ -32,11 +32,11 @@
  */
 public abstract class StateSplit extends Instruction {
 
-    private static final int INPUT_COUNT = 2;
-    private static final int INPUT_STATE_AFTER = 0;
-    private static final int INPUT_STATE_BEFORE = 1;
+    private static final int INPUT_COUNT = 1;
+    private static final int INPUT_STATE_BEFORE = 0;
 
-    private static final int SUCCESSOR_COUNT = 0;
+    private static final int SUCCESSOR_COUNT = 1;
+    private static final int SUCCESSOR_STATE_AFTER = 0;
 
     @Override
     protected int inputCount() {
@@ -51,22 +51,6 @@
     /**
      * The state for this instruction.
      */
-     @Override
-    public FrameState stateAfter() {
-        return (FrameState) inputs().get(super.inputCount() + INPUT_STATE_AFTER);
-    }
-
-    public FrameState setStateAfter(FrameState n) {
-        if (n != null && this instanceof BlockBegin) {
-            Exception e = new Exception();
-            e.printStackTrace();
-        }
-        return (FrameState) inputs().set(super.inputCount() + INPUT_STATE_AFTER, n);
-    }
-
-    /**
-     * The state for this instruction.
-     */
     public FrameState stateBefore() {
         return (FrameState) inputs().get(super.inputCount() + INPUT_STATE_BEFORE);
     }
@@ -76,6 +60,18 @@
     }
 
     /**
+     * The state for this instruction.
+     */
+     @Override
+    public FrameState stateAfter() {
+        return (FrameState) successors().get(super.successorCount() + SUCCESSOR_STATE_AFTER);
+    }
+
+    public FrameState setStateAfter(FrameState n) {
+        return (FrameState) successors().set(super.successorCount() + SUCCESSOR_STATE_AFTER, n);
+    }
+
+    /**
      * Creates a new state split with the specified value type.
      * @param kind the type of the value that this instruction produces
      * @param inputCount