comparison 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
comparison
equal deleted inserted replaced
2677:0ea5f12e873a 2707:7ed72769d51a
30 * The {@code StateSplit} class is the abstract base class of all instructions 30 * The {@code StateSplit} class is the abstract base class of all instructions
31 * that store an immutable copy of the frame state. 31 * that store an immutable copy of the frame state.
32 */ 32 */
33 public abstract class StateSplit extends Instruction { 33 public abstract class StateSplit extends Instruction {
34 34
35 private static final int INPUT_COUNT = 2; 35 private static final int INPUT_COUNT = 1;
36 private static final int INPUT_STATE_AFTER = 0; 36 private static final int INPUT_STATE_BEFORE = 0;
37 private static final int INPUT_STATE_BEFORE = 1;
38 37
39 private static final int SUCCESSOR_COUNT = 0; 38 private static final int SUCCESSOR_COUNT = 1;
39 private static final int SUCCESSOR_STATE_AFTER = 0;
40 40
41 @Override 41 @Override
42 protected int inputCount() { 42 protected int inputCount() {
43 return super.inputCount() + INPUT_COUNT; 43 return super.inputCount() + INPUT_COUNT;
44 } 44 }
49 } 49 }
50 50
51 /** 51 /**
52 * The state for this instruction. 52 * The state for this instruction.
53 */ 53 */
54 @Override
55 public FrameState stateAfter() {
56 return (FrameState) inputs().get(super.inputCount() + INPUT_STATE_AFTER);
57 }
58
59 public FrameState setStateAfter(FrameState n) {
60 if (n != null && this instanceof BlockBegin) {
61 Exception e = new Exception();
62 e.printStackTrace();
63 }
64 return (FrameState) inputs().set(super.inputCount() + INPUT_STATE_AFTER, n);
65 }
66
67 /**
68 * The state for this instruction.
69 */
70 public FrameState stateBefore() { 54 public FrameState stateBefore() {
71 return (FrameState) inputs().get(super.inputCount() + INPUT_STATE_BEFORE); 55 return (FrameState) inputs().get(super.inputCount() + INPUT_STATE_BEFORE);
72 } 56 }
73 57
74 public FrameState setStateBefore(FrameState n) { 58 public FrameState setStateBefore(FrameState n) {
75 return (FrameState) inputs().set(super.inputCount() + INPUT_STATE_BEFORE, n); 59 return (FrameState) inputs().set(super.inputCount() + INPUT_STATE_BEFORE, n);
60 }
61
62 /**
63 * The state for this instruction.
64 */
65 @Override
66 public FrameState stateAfter() {
67 return (FrameState) successors().get(super.successorCount() + SUCCESSOR_STATE_AFTER);
68 }
69
70 public FrameState setStateAfter(FrameState n) {
71 return (FrameState) successors().set(super.successorCount() + SUCCESSOR_STATE_AFTER, n);
76 } 72 }
77 73
78 /** 74 /**
79 * Creates a new state split with the specified value type. 75 * Creates a new state split with the specified value type.
80 * @param kind the type of the value that this instruction produces 76 * @param kind the type of the value that this instruction produces