comparison truffle/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/instrument/InstrumentationTest.java @ 22230:3f2052afcb6d

Truffle/Instrumentation: rename the methods in the Instrument listener classes to use the "on" convention, e.g. onEnter(), add Javadoc
author Michael Van De Vanter <michael.van.de.vanter@oracle.com>
date Sun, 20 Sep 2015 16:48:50 -0700
parents c896a8e70777
children 0fb3522e5b72
comparison
equal deleted inserted replaced
22229:a4ac9f2ff2bf 22230:3f2052afcb6d
237 237
238 @Override 238 @Override
239 public void attach(Probe probe) { 239 public void attach(Probe probe) {
240 instrument = instrumenter.attach(probe, new SimpleInstrumentListener() { 240 instrument = instrumenter.attach(probe, new SimpleInstrumentListener() {
241 241
242 public void enter(Probe p) { 242 public void onEnter(Probe p) {
243 enterCount++; 243 enterCount++;
244 } 244 }
245 245
246 public void returnVoid(Probe p) { 246 public void onReturnVoid(Probe p) {
247 leaveCount++; 247 leaveCount++;
248 } 248 }
249 249
250 public void returnValue(Probe p, Object result) { 250 public void onReturnValue(Probe p, Object result) {
251 leaveCount++; 251 leaveCount++;
252 } 252 }
253 253
254 public void returnExceptional(Probe p, Exception exception) { 254 public void onReturnExceptional(Probe p, Exception exception) {
255 leaveCount++; 255 leaveCount++;
256 } 256 }
257 257
258 }, "Instrumentation Test Counter"); 258 }, "Instrumentation Test Counter");
259 } 259 }
290 290
291 @Override 291 @Override
292 public void attach(Probe probe) { 292 public void attach(Probe probe) {
293 instrument = instrumenter.attach(probe, new StandardInstrumentListener() { 293 instrument = instrumenter.attach(probe, new StandardInstrumentListener() {
294 294
295 public void enter(Probe p, Node node, VirtualFrame vFrame) { 295 public void onEnter(Probe p, Node node, VirtualFrame vFrame) {
296 enterCount++; 296 enterCount++;
297 } 297 }
298 298
299 public void returnVoid(Probe p, Node node, VirtualFrame vFrame) { 299 public void onReturnVoid(Probe p, Node node, VirtualFrame vFrame) {
300 leaveCount++; 300 leaveCount++;
301 } 301 }
302 302
303 public void returnValue(Probe p, Node node, VirtualFrame vFrame, Object result) { 303 public void onReturnValue(Probe p, Node node, VirtualFrame vFrame, Object result) {
304 leaveCount++; 304 leaveCount++;
305 } 305 }
306 306
307 public void returnExceptional(Probe p, Node node, VirtualFrame vFrame, Exception exception) { 307 public void onReturnExceptional(Probe p, Node node, VirtualFrame vFrame, Exception exception) {
308 leaveCount++; 308 leaveCount++;
309 } 309 }
310 310
311 }, "Instrumentation Test Counter"); 311 }, "Instrumentation Test Counter");
312 } 312 }
357 static final class TestSimpleInstrumentListener extends DefaultSimpleInstrumentListener { 357 static final class TestSimpleInstrumentListener extends DefaultSimpleInstrumentListener {
358 358
359 public int counter = 0; 359 public int counter = 0;
360 360
361 @Override 361 @Override
362 public void enter(Probe probe) { 362 public void onEnter(Probe probe) {
363 counter++; 363 counter++;
364 } 364 }
365 } 365 }
366 366
367 /** 367 /**
370 static final class TestASTInstrumentListener extends DefaultStandardInstrumentListener { 370 static final class TestASTInstrumentListener extends DefaultStandardInstrumentListener {
371 371
372 public int counter = 0; 372 public int counter = 0;
373 373
374 @Override 374 @Override
375 public void enter(Probe probe, Node node, VirtualFrame vFrame) { 375 public void onEnter(Probe probe, Node node, VirtualFrame vFrame) {
376 counter++; 376 counter++;
377 } 377 }
378 } 378 }
379 379
380 private static final class TestProbeListener extends DefaultProbeListener { 380 private static final class TestProbeListener extends DefaultProbeListener {