Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/ProbeNode.java @ 20104:d7c48ee7ed4b
Truffle/Instrumentation: field renaming in ProbeNode
author | Michael Van De Vanter <michael.van.de.vanter@oracle.com> |
---|---|
date | Tue, 31 Mar 2015 18:56:42 -0700 |
parents | 1d6a7ea5de59 |
children | 21298b90a6bf |
comparison
equal
deleted
inserted
replaced
20051:b7477f2df553 | 20104:d7c48ee7ed4b |
---|---|
127 // Never changed once set. | 127 // Never changed once set. |
128 @CompilationFinal Probe probe = null; | 128 @CompilationFinal Probe probe = null; |
129 /** | 129 /** |
130 * First {@link AbstractInstrumentNode} node in chain; {@code null} of no instruments in chain. | 130 * First {@link AbstractInstrumentNode} node in chain; {@code null} of no instruments in chain. |
131 */ | 131 */ |
132 @Child protected AbstractInstrumentNode firstInstrument; | 132 @Child protected AbstractInstrumentNode firstInstrumentNode; |
133 | 133 |
134 @Override | 134 @Override |
135 public boolean isInstrumentable() { | 135 public boolean isInstrumentable() { |
136 return false; | 136 return false; |
137 } | 137 } |
154 this.probe.checkProbeUnchanged(); | 154 this.probe.checkProbeUnchanged(); |
155 final SyntaxTagTrap trap = probe.getTrap(); | 155 final SyntaxTagTrap trap = probe.getTrap(); |
156 if (trap != null) { | 156 if (trap != null) { |
157 trap.tagTrappedAt(((WrapperNode) this.getParent()).getChild(), vFrame.materialize()); | 157 trap.tagTrappedAt(((WrapperNode) this.getParent()).getChild(), vFrame.materialize()); |
158 } | 158 } |
159 if (firstInstrument != null) { | 159 if (firstInstrumentNode != null) { |
160 firstInstrument.enter(node, vFrame); | 160 firstInstrumentNode.enter(node, vFrame); |
161 } | 161 } |
162 } | 162 } |
163 | 163 |
164 public void returnVoid(Node node, VirtualFrame vFrame) { | 164 public void returnVoid(Node node, VirtualFrame vFrame) { |
165 this.probe.checkProbeUnchanged(); | 165 this.probe.checkProbeUnchanged(); |
166 if (firstInstrument != null) { | 166 if (firstInstrumentNode != null) { |
167 firstInstrument.returnVoid(node, vFrame); | 167 firstInstrumentNode.returnVoid(node, vFrame); |
168 } | 168 } |
169 } | 169 } |
170 | 170 |
171 public void returnValue(Node node, VirtualFrame vFrame, Object result) { | 171 public void returnValue(Node node, VirtualFrame vFrame, Object result) { |
172 this.probe.checkProbeUnchanged(); | 172 this.probe.checkProbeUnchanged(); |
173 if (firstInstrument != null) { | 173 if (firstInstrumentNode != null) { |
174 firstInstrument.returnValue(node, vFrame, result); | 174 firstInstrumentNode.returnValue(node, vFrame, result); |
175 } | 175 } |
176 } | 176 } |
177 | 177 |
178 public void returnExceptional(Node node, VirtualFrame vFrame, Exception exception) { | 178 public void returnExceptional(Node node, VirtualFrame vFrame, Exception exception) { |
179 this.probe.checkProbeUnchanged(); | 179 this.probe.checkProbeUnchanged(); |
180 if (firstInstrument != null) { | 180 if (firstInstrumentNode != null) { |
181 firstInstrument.returnExceptional(node, vFrame, exception); | 181 firstInstrumentNode.returnExceptional(node, vFrame, exception); |
182 } | 182 } |
183 } | 183 } |
184 | 184 |
185 public String instrumentationInfo() { | 185 public String instrumentationInfo() { |
186 return "Standard probe"; | 186 return "Standard probe"; |
192 @TruffleBoundary | 192 @TruffleBoundary |
193 void addInstrument(Instrument instrument) { | 193 void addInstrument(Instrument instrument) { |
194 assert instrument.getProbe() == probe; | 194 assert instrument.getProbe() == probe; |
195 // The existing chain of nodes may be empty | 195 // The existing chain of nodes may be empty |
196 // Attach the modified chain. | 196 // Attach the modified chain. |
197 firstInstrument = insert(instrument.addToChain(firstInstrument)); | 197 firstInstrumentNode = insert(instrument.addToChain(firstInstrumentNode)); |
198 } | 198 } |
199 | 199 |
200 /** | 200 /** |
201 * Removes an instrument from this chain of instruments. | 201 * Removes an instrument from this chain of instruments. |
202 * | 202 * |
203 * @throws RuntimeException if no matching instrument is found, | 203 * @throws RuntimeException if no matching instrument is found, |
204 */ | 204 */ |
205 @TruffleBoundary | 205 @TruffleBoundary |
206 void removeInstrument(Instrument instrument) { | 206 void removeInstrument(Instrument instrument) { |
207 assert instrument.getProbe() == probe; | 207 assert instrument.getProbe() == probe; |
208 final AbstractInstrumentNode modifiedChain = instrument.removeFromChain(firstInstrument); | 208 final AbstractInstrumentNode modifiedChain = instrument.removeFromChain(firstInstrumentNode); |
209 if (modifiedChain == null) { | 209 if (modifiedChain == null) { |
210 firstInstrument = null; | 210 firstInstrumentNode = null; |
211 } else { | 211 } else { |
212 firstInstrument = insert(modifiedChain); | 212 firstInstrumentNode = insert(modifiedChain); |
213 } | 213 } |
214 } | 214 } |
215 | 215 |
216 } | 216 } |