comparison 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
comparison
equal deleted inserted replaced
15943:14ac87c56a27 15944:eedf6c293639
69 assert listener != null; 69 assert listener != null;
70 sourceListeners.add(listener); 70 sourceListeners.add(listener);
71 } 71 }
72 72
73 /** 73 /**
74 * Unregisters a tool interested in being notified about the loading of {@link Source}s.
75 */
76 public final void removeSourceListener(SourceListener removeListener) {
77 final List<SourceListener> listeners = new ArrayList<>(sourceListeners);
78 for (SourceListener listener : listeners) {
79 if (listener == removeListener) {
80 sourceListeners.remove(listener);
81 }
82 }
83 }
84
85 /**
74 * Registers a tool interested in being notified about the insertion of a newly created 86 * Registers a tool interested in being notified about the insertion of a newly created
75 * {@link Probe} into a Truffle AST. 87 * {@link Probe} into a Truffle AST.
76 */ 88 */
77 public final void addProbeListener(ProbeListener listener) { 89 public final void addProbeListener(ProbeListener listener) {
78 probeManager.addProbeListener(listener); 90 probeManager.addProbeListener(listener);
91 }
92
93 /**
94 * Unregisters a tool interested in being notified about the insertion of a newly created
95 * {@link Probe} into a Truffle AST.
96 */
97 public final void removeProbeListener(ProbeListener listener) {
98 probeManager.removeProbeListener(listener);
79 } 99 }
80 100
81 /** 101 /**
82 * Return the (possibly newly created) {@link Probe} uniquely associated with a particular 102 * Return the (possibly newly created) {@link Probe} uniquely associated with a particular
83 * source code location. A newly created probe carries no tags. 103 * source code location. A newly created probe carries no tags.