comparison graal/GraalCompiler/src/com/sun/c1x/ir/StateSplit.java @ 2622:91d3952f7eb7

Framestate work : using stateAFter and reducting the number of nodes with framestates. Intermediate state (does not pass tests)
author Gilles Duboscq <gilles.duboscq@oracle.com>
date Tue, 10 May 2011 12:37:46 +0200
parents 3558ca7088c0
children 569228710be8
comparison
equal deleted inserted replaced
2621:dd115f80acf8 2622:91d3952f7eb7
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 = 1; 35 private static final int INPUT_COUNT = 1;
36 private static final int INPUT_STATE_BEFORE = 0; 36 private static final int INPUT_STATE_AFTER = 0;
37 37
38 private static final int SUCCESSOR_COUNT = 0; 38 private static final int SUCCESSOR_COUNT = 0;
39 39
40 @Override 40 @Override
41 protected int inputCount() { 41 protected int inputCount() {
49 49
50 /** 50 /**
51 * The state for this instruction. 51 * The state for this instruction.
52 */ 52 */
53 @Override 53 @Override
54 public FrameState stateBefore() { 54 public FrameState stateAfter() {
55 return (FrameState) inputs().get(super.inputCount() + INPUT_STATE_BEFORE); 55 return (FrameState) inputs().get(super.inputCount() + INPUT_STATE_AFTER);
56 } 56 }
57 57
58 public FrameState setStateBefore(FrameState n) { 58 public FrameState setStateAfter(FrameState n) {
59 return (FrameState) inputs().set(super.inputCount() + INPUT_STATE_BEFORE, n); 59 return (FrameState) inputs().set(super.inputCount() + INPUT_STATE_AFTER, n);
60 } 60 }
61 61
62 /** 62 /**
63 * Creates a new state split with the specified value type. 63 * Creates a new state split with the specified value type.
64 * @param kind the type of the value that this instruction produces 64 * @param kind the type of the value that this instruction produces
65 * @param inputCount 65 * @param inputCount
66 * @param successorCount 66 * @param successorCount
67 * @param graph 67 * @param graph
68 */ 68 */
69 public StateSplit(CiKind kind, FrameState stateBefore, int inputCount, int successorCount, Graph graph) { 69 public StateSplit(CiKind kind, FrameState stateAfter, int inputCount, int successorCount, Graph graph) {
70 super(kind, inputCount + INPUT_COUNT, successorCount + SUCCESSOR_COUNT, graph); 70 super(kind, inputCount + INPUT_COUNT, successorCount + SUCCESSOR_COUNT, graph);
71 setStateBefore(stateBefore); 71 this.setStateAfter(stateAfter);
72 } 72 }
73 73
74 @Override 74 @Override
75 public boolean canTrap() { 75 public boolean canTrap() {
76 return stateBefore() != null; 76 return true;
77 } 77 }
78 78
79 } 79 }