Mercurial > hg > graal-compiler
comparison graal/GraalCompiler/src/com/sun/c1x/ir/MonitorEnter.java @ 2616:3558ca7088c0
FrameState and Graphviz changes:
* removed popx, pushx methods from GraphBuilder
* FrameState subclass of Value
* added String shortName() to Node
* added GraphvizPrinter option to use short names
* small hack in GraphvizPrinter: omit FrameState->Local connections
* added GraalGraphviz to implicit classpatch (read from GRAAL env var)
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Mon, 09 May 2011 17:00:25 +0200 |
parents | 1c36b17f7ee0 |
children | dd115f80acf8 |
comparison
equal
deleted
inserted
replaced
2615:5768534fd4e5 | 2616:3558ca7088c0 |
---|---|
29 /** | 29 /** |
30 * The {@code MonitorEnter} instruction represents the acquisition of a monitor. | 30 * The {@code MonitorEnter} instruction represents the acquisition of a monitor. |
31 */ | 31 */ |
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 = 1; |
35 private static final int INPUT_STATE_AFTER = 0; | |
36 | |
35 private static final int SUCCESSOR_COUNT = 0; | 37 private static final int SUCCESSOR_COUNT = 0; |
36 | 38 |
37 private FrameState stateAfter; | 39 @Override |
40 protected int inputCount() { | |
41 return super.inputCount() + INPUT_COUNT; | |
42 } | |
43 | |
44 @Override | |
45 protected int successorCount() { | |
46 return super.successorCount() + SUCCESSOR_COUNT; | |
47 } | |
48 | |
49 /** | |
50 * The state for this instruction. | |
51 */ | |
52 @Override | |
53 public FrameState stateAfter() { | |
54 return (FrameState) inputs().get(super.inputCount() + INPUT_STATE_AFTER); | |
55 } | |
56 | |
57 public FrameState setStateAfter(FrameState n) { | |
58 return (FrameState) inputs().set(super.inputCount() + INPUT_STATE_AFTER, n); | |
59 } | |
38 | 60 |
39 /** | 61 /** |
40 * Creates a new MonitorEnter instruction. | 62 * Creates a new MonitorEnter instruction. |
41 * | 63 * |
42 * @param object the instruction producing the object | 64 * @param object the instruction producing the object |
52 @Override | 74 @Override |
53 public void accept(ValueVisitor v) { | 75 public void accept(ValueVisitor v) { |
54 v.visitMonitorEnter(this); | 76 v.visitMonitorEnter(this); |
55 } | 77 } |
56 | 78 |
57 public void setStateAfter(FrameState frameState) { | |
58 this.stateAfter = frameState; | |
59 } | |
60 | |
61 @Override | |
62 public FrameState stateAfter() { | |
63 return stateAfter; | |
64 } | |
65 | |
66 @Override | 79 @Override |
67 public void print(LogStream out) { | 80 public void print(LogStream out) { |
68 out.print("enter monitor[").print(lockNumber).print("](").print(object()).print(')'); | 81 out.print("enter monitor[").print(lockNumber).print("](").print(object()).print(')'); |
69 } | 82 } |
70 } | 83 } |