Mercurial > hg > graal-jvmci-8
comparison graal/GraalCompiler/src/com/sun/c1x/ir/MonitorEnter.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 | dd115f80acf8 |
children | 569228710be8 |
comparison
equal
deleted
inserted
replaced
2621:dd115f80acf8 | 2622:91d3952f7eb7 |
---|---|
32 public final class MonitorEnter extends AccessMonitor { | 32 public final class MonitorEnter extends AccessMonitor { |
33 | 33 |
34 private static final int INPUT_COUNT = 0; | 34 private static final int INPUT_COUNT = 0; |
35 | 35 |
36 private static final int SUCCESSOR_COUNT = 1; | 36 private static final int SUCCESSOR_COUNT = 1; |
37 private static final int SUCCESSOR_STATE_AFTER = 0; | |
38 | |
39 @Override | |
40 protected int inputCount() { | |
41 return super.inputCount() + INPUT_COUNT; | |
42 } | |
43 | 37 |
44 @Override | 38 @Override |
45 protected int successorCount() { | 39 protected int successorCount() { |
46 return super.successorCount() + SUCCESSOR_COUNT; | 40 return super.successorCount() + SUCCESSOR_COUNT; |
47 } | |
48 | |
49 /** | |
50 * The state for this instruction. | |
51 */ | |
52 @Override | |
53 public FrameState stateAfter() { | |
54 return (FrameState) successors().get(super.successorCount() + SUCCESSOR_STATE_AFTER); | |
55 } | |
56 | |
57 public FrameState setStateAfter(FrameState n) { | |
58 return (FrameState) successors().set(super.successorCount() + SUCCESSOR_STATE_AFTER, n); | |
59 } | 41 } |
60 | 42 |
61 /** | 43 /** |
62 * Creates a new MonitorEnter instruction. | 44 * Creates a new MonitorEnter instruction. |
63 * | 45 * |
64 * @param object the instruction producing the object | 46 * @param object the instruction producing the object |
65 * @param lockAddress the address of the on-stack lock object or {@code null} if the runtime does not place locks on the stack | 47 * @param lockAddress the address of the on-stack lock object or {@code null} if the runtime does not place locks on the stack |
66 * @param lockNumber the number of the lock | 48 * @param lockNumber the number of the lock |
67 * @param stateBefore the state before | 49 * @param stateAfter the state after |
68 * @param graph | 50 * @param graph |
69 */ | 51 */ |
70 public MonitorEnter(Value object, Value lockAddress, int lockNumber, FrameState stateBefore, Graph graph) { | 52 public MonitorEnter(Value object, Value lockAddress, int lockNumber, FrameState stateAfter, Graph graph) { |
71 super(object, lockAddress, stateBefore, lockNumber, INPUT_COUNT, SUCCESSOR_COUNT, graph); | 53 super(object, lockAddress, stateAfter, lockNumber, INPUT_COUNT, SUCCESSOR_COUNT, graph); |
72 } | 54 } |
73 | 55 |
74 @Override | 56 @Override |
75 public void accept(ValueVisitor v) { | 57 public void accept(ValueVisitor v) { |
76 v.visitMonitorEnter(this); | 58 v.visitMonitorEnter(this); |