comparison graal/GraalCompiler/src/com/sun/c1x/ir/Throw.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 a0dd2b907806
comparison
equal deleted inserted replaced
2677:0ea5f12e873a 2707:7ed72769d51a
34 34
35 private static final int INPUT_COUNT = 2; 35 private static final int INPUT_COUNT = 2;
36 private static final int INPUT_EXCEPTION = 0; 36 private static final int INPUT_EXCEPTION = 0;
37 private static final int INPUT_STATE_BEFORE = 1; 37 private static final int INPUT_STATE_BEFORE = 1;
38 38
39 private static final int SUCCESSOR_COUNT = 0; 39 private static final int SUCCESSOR_COUNT = 1;
40 private static final int SUCCESSOR_EXCEPTION_EDGE = 0;
40 41
41 @Override 42 @Override
42 protected int inputCount() { 43 protected int inputCount() {
43 return super.inputCount() + INPUT_COUNT; 44 return super.inputCount() + INPUT_COUNT;
44 } 45 }
69 public FrameState setStateBefore(FrameState n) { 70 public FrameState setStateBefore(FrameState n) {
70 return (FrameState) inputs().set(super.inputCount() + INPUT_STATE_BEFORE, n); 71 return (FrameState) inputs().set(super.inputCount() + INPUT_STATE_BEFORE, n);
71 } 72 }
72 73
73 /** 74 /**
75 * The entry to the exception dispatch chain for this throw.
76 * TODO ls: this needs more cleanup - throw should either unwind or jump to the exception dispatch chain
77 */
78 @Override
79 public BlockBegin exceptionEdge() {
80 return (BlockBegin) successors().get(super.successorCount() + SUCCESSOR_EXCEPTION_EDGE);
81 }
82
83 public BlockBegin setExceptionEdge(BlockBegin n) {
84 return (BlockBegin) successors().set(super.successorCount() + SUCCESSOR_EXCEPTION_EDGE, n);
85 }
86
87 /**
74 * Creates a new Throw instruction. 88 * Creates a new Throw instruction.
75 * @param exception the instruction that generates the exception to throw 89 * @param exception the instruction that generates the exception to throw
76 * @param stateAfter the state before the exception is thrown but after the exception object has been popped 90 * @param stateAfter the state before the exception is thrown but after the exception object has been popped
77 * @param isSafepoint {@code true} if this instruction is a safepoint instruction 91 * @param isSafepoint {@code true} if this instruction is a safepoint instruction
78 * @param graph 92 * @param graph