Mercurial > hg > graal-compiler
comparison graal/GraalCompiler/src/com/sun/c1x/ir/StateSplit.java @ 2634:4dd0573f510b
FrameState fixes.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Wed, 11 May 2011 10:52:37 +0200 |
parents | 569228710be8 |
children | 440ceca8e3d7 |
comparison
equal
deleted
inserted
replaced
2633:721a45190d6d | 2634:4dd0573f510b |
---|---|
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 = 1; | 35 private static final int INPUT_COUNT = 2; |
36 private static final int INPUT_STATE_AFTER = 0; | 36 private static final int INPUT_STATE_AFTER = 0; |
37 private static final int INPUT_STATE_BEFORE = 1; | |
37 | 38 |
38 private static final int SUCCESSOR_COUNT = 0; | 39 private static final int SUCCESSOR_COUNT = 0; |
39 | 40 |
40 @Override | 41 @Override |
41 protected int inputCount() { | 42 protected int inputCount() { |
54 public FrameState stateAfter() { | 55 public FrameState stateAfter() { |
55 return (FrameState) inputs().get(super.inputCount() + INPUT_STATE_AFTER); | 56 return (FrameState) inputs().get(super.inputCount() + INPUT_STATE_AFTER); |
56 } | 57 } |
57 | 58 |
58 public FrameState setStateAfter(FrameState n) { | 59 public FrameState setStateAfter(FrameState n) { |
60 if (n != null && this instanceof BlockBegin) { | |
61 Exception e = new Exception(); | |
62 e.printStackTrace(); | |
63 } | |
59 return (FrameState) inputs().set(super.inputCount() + INPUT_STATE_AFTER, n); | 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() { | |
71 return (FrameState) inputs().get(super.inputCount() + INPUT_STATE_BEFORE); | |
72 } | |
73 | |
74 public FrameState setStateBefore(FrameState n) { | |
75 return (FrameState) inputs().set(super.inputCount() + INPUT_STATE_BEFORE, n); | |
60 } | 76 } |
61 | 77 |
62 /** | 78 /** |
63 * Creates a new state split with the specified value type. | 79 * Creates a new state split with the specified value type. |
64 * @param kind the type of the value that this instruction produces | 80 * @param kind the type of the value that this instruction produces |