diff truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/SimpleInstrumentListener.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 dc83cc1f94f2
children e7643754d982
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/SimpleInstrumentListener.java	Sun Sep 20 16:47:26 2015 -0700
+++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/SimpleInstrumentListener.java	Sun Sep 20 16:48:50 2015 -0700
@@ -27,7 +27,7 @@
 import com.oracle.truffle.api.source.SourceSection;
 
 /**
- * A receiver of Truffle execution events that can act on behalf of an external client.
+ * A receiver of Truffle AST execution events that can act on behalf of an external client.
  * <p>
  * The {@link Probe} instance provides access to the {@link SourceSection} associated with the
  * event, as well as any {@link SyntaxTag}s that have been applied at that program's location.
@@ -39,6 +39,9 @@
  * Clients are free, of course, to record additional information in the listener implementation that
  * carries additional information about the context and reason for the particular {@link Instrument}
  * that is to be created from the listener.
+ * <p>
+ * Notification is fully synchronous, so overrides have performance implications. Non-trivial
+ * methods should be coded with Truffle guidelines and cautions in mind.
  */
 public interface SimpleInstrumentListener {
 
@@ -47,7 +50,7 @@
      * <p>
      * <strong>Synchronous</strong>: Truffle execution waits until the call returns.
      */
-    void enter(Probe probe);
+    void onEnter(Probe probe);
 
     /**
      * Receive notification that a program location's {@code void}-valued execution has just
@@ -55,7 +58,7 @@
      * <p>
      * <strong>Synchronous</strong>: Truffle execution waits until the call returns.
      */
-    void returnVoid(Probe probe);
+    void onReturnVoid(Probe probe);
 
     /**
      * Receive notification that a program location's execution has just completed and returned a
@@ -63,12 +66,12 @@
      * <p>
      * <strong>Synchronous</strong>: Truffle execution waits until the call returns.
      */
-    void returnValue(Probe probe, Object result);
+    void onReturnValue(Probe probe, Object result);
 
     /**
      * Receive notification that a program location's execution has just thrown an exception.
      * <p>
      * <strong>Synchronous</strong>: Truffle execution waits until the call returns.
      */
-    void returnExceptional(Probe probe, Exception exception);
+    void onReturnExceptional(Probe probe, Exception exception);
 }