comparison 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
comparison
equal deleted inserted replaced
2638:3e47aeb60ab3 2639:8e96b2b3a866
22 */ 22 */
23 package com.sun.c1x.ir; 23 package com.sun.c1x.ir;
24 24
25 import com.oracle.graal.graph.*; 25 import com.oracle.graal.graph.*;
26 import com.sun.c1x.debug.*; 26 import com.sun.c1x.debug.*;
27 import com.sun.c1x.value.*;
27 import com.sun.cri.ci.*; 28 import com.sun.cri.ci.*;
28 29
29 /** 30 /**
30 * The {@code Throw} instruction represents a throw of an exception. 31 * The {@code Throw} instruction represents a throw of an exception.
31 */ 32 */
32 public final class Throw extends BlockEnd { 33 public final class Throw extends BlockEnd {
33 34
34 private static final int INPUT_COUNT = 1; 35 private static final int INPUT_COUNT = 2;
35 private static final int INPUT_EXCEPTION = 0; 36 private static final int INPUT_EXCEPTION = 0;
37 private static final int INPUT_STATE_BEFORE = 1;
36 38
37 private static final int SUCCESSOR_COUNT = 0; 39 private static final int SUCCESSOR_COUNT = 0;
38 40
39 @Override 41 @Override
40 protected int inputCount() { 42 protected int inputCount() {
53 return (Value) inputs().get(super.inputCount() + INPUT_EXCEPTION); 55 return (Value) inputs().get(super.inputCount() + INPUT_EXCEPTION);
54 } 56 }
55 57
56 public Value setException(Value n) { 58 public Value setException(Value n) {
57 return (Value) inputs().set(super.inputCount() + INPUT_EXCEPTION, n); 59 return (Value) inputs().set(super.inputCount() + INPUT_EXCEPTION, n);
60 }
61
62 /**
63 * The state for this instruction.
64 */
65 public FrameState stateBefore() {
66 return (FrameState) inputs().get(super.inputCount() + INPUT_STATE_BEFORE);
67 }
68
69 public FrameState setStateBefore(FrameState n) {
70 return (FrameState) inputs().set(super.inputCount() + INPUT_STATE_BEFORE, n);
58 } 71 }
59 72
60 /** 73 /**
61 * Creates a new Throw instruction. 74 * Creates a new Throw instruction.
62 * @param exception the instruction that generates the exception to throw 75 * @param exception the instruction that generates the exception to throw