diff graal/GraalCompiler/src/com/sun/c1x/ir/Throw.java @ 2639:8e96b2b3a866

Added stateBefore to Throw instruction.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 11 May 2011 13:41:35 +0200
parents 91d3952f7eb7
children 440ceca8e3d7
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/Throw.java	Wed May 11 12:10:41 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/ir/Throw.java	Wed May 11 13:41:35 2011 +0200
@@ -24,6 +24,7 @@
 
 import com.oracle.graal.graph.*;
 import com.sun.c1x.debug.*;
+import com.sun.c1x.value.*;
 import com.sun.cri.ci.*;
 
 /**
@@ -31,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,6 +60,17 @@
     }
 
     /**
+     * The state for this instruction.
+     */
+    public FrameState stateBefore() {
+        return (FrameState) inputs().get(super.inputCount() + INPUT_STATE_BEFORE);
+    }
+
+    public FrameState setStateBefore(FrameState n) {
+        return (FrameState) inputs().set(super.inputCount() + INPUT_STATE_BEFORE, n);
+    }
+
+    /**
      * Creates a new Throw instruction.
      * @param exception the instruction that generates the exception to throw
      * @param stateAfter the state before the exception is thrown but after the exception object has been popped