diff graal/com.oracle.truffle.api/src/com/oracle/truffle/api/ExecutionContext.java @ 15944:eedf6c293639

Truffle: additional methods on ExecutionContext
author Michael Van De Vanter <michael.van.de.vanter@oracle.com>
date Tue, 27 May 2014 21:18:45 -0700
parents 09ac9ac9c4fc
children 915ebb306fcc
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/ExecutionContext.java	Tue May 27 21:18:16 2014 -0700
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/ExecutionContext.java	Tue May 27 21:18:45 2014 -0700
@@ -71,6 +71,18 @@
     }
 
     /**
+     * Unregisters a tool interested in being notified about the loading of {@link Source}s.
+     */
+    public final void removeSourceListener(SourceListener removeListener) {
+        final List<SourceListener> listeners = new ArrayList<>(sourceListeners);
+        for (SourceListener listener : listeners) {
+            if (listener == removeListener) {
+                sourceListeners.remove(listener);
+            }
+        }
+    }
+
+    /**
      * Registers a tool interested in being notified about the insertion of a newly created
      * {@link Probe} into a Truffle AST.
      */
@@ -79,6 +91,14 @@
     }
 
     /**
+     * Unregisters a tool interested in being notified about the insertion of a newly created
+     * {@link Probe} into a Truffle AST.
+     */
+    public final void removeProbeListener(ProbeListener listener) {
+        probeManager.removeProbeListener(listener);
+    }
+
+    /**
      * Return the (possibly newly created) {@link Probe} uniquely associated with a particular
      * source code location. A newly created probe carries no tags.
      *