Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/ExecutionContext.java @ 16856:7833417c8172
Changes to Instrumentation
author | David Piorkowski <david.piorkowski@oracle.com> |
---|---|
date | Mon, 18 Aug 2014 14:36:12 -0700 |
parents | 50d79ad439f1 |
children | 7bfbad29d331 |
comparison
equal
deleted
inserted
replaced
16855:226552569e34 | 16856:7833417c8172 |
---|---|
43 private Visualizer visualizer = new DefaultVisualizer(); | 43 private Visualizer visualizer = new DefaultVisualizer(); |
44 | 44 |
45 protected ExecutionContext() { | 45 protected ExecutionContext() { |
46 } | 46 } |
47 | 47 |
48 /** | |
49 * Sets up the {@link SourceCallback} for this execution context. | |
50 */ | |
48 public void initialize() { | 51 public void initialize() { |
49 setSourceCallback(new SourceCallback() { | 52 setSourceCallback(new SourceCallback() { |
50 | 53 |
51 public void startLoading(Source source) { | 54 public void startLoading(Source source) { |
52 for (SourceListener listener : sourceListeners) { | 55 for (SourceListener listener : sourceListeners) { |
97 public final void removeProbeListener(ProbeListener listener) { | 100 public final void removeProbeListener(ProbeListener listener) { |
98 probeManager.removeProbeListener(listener); | 101 probeManager.removeProbeListener(listener); |
99 } | 102 } |
100 | 103 |
101 /** | 104 /** |
102 * Return the (possibly newly created) {@link Probe} uniquely associated with a particular | 105 * Return a newly created {@link Probe} uniquely associated with a particular source section. A |
103 * source code location. A newly created probe carries no tags. | 106 * newly created probe carries no tags. |
104 * | 107 * |
105 * @return a probe uniquely associated with an extent of guest language source code. | 108 * @return a probe uniquely associated with an extent of guest language source code. |
106 */ | 109 */ |
107 public final Probe getProbe(SourceSection sourceSection) { | 110 public final Probe createProbe(SourceSection source) { |
108 return probeManager.getProbe(sourceSection); | 111 return probeManager.createProbe(source); |
109 } | |
110 | |
111 /** | |
112 * Has a {@link Probe} been created that is uniquely associated with a particular source code | |
113 * location. | |
114 * | |
115 * @return a probe uniquely associated with an extent of guest language source code. | |
116 */ | |
117 public final boolean hasProbe(SourceSection sourceSection) { | |
118 return probeManager.hasProbe(sourceSection); | |
119 } | 112 } |
120 | 113 |
121 /** | 114 /** |
122 * Returns all existing probes with specific tag, or all probes if {@code tag = null}; empty | 115 * Returns all existing probes with specific tag, or all probes if {@code tag = null}; empty |
123 * collection if no probes found. | 116 * collection if no probes found. |
124 */ | 117 */ |
125 public final Collection<Probe> findProbesTaggedAs(SyntaxTag tag) { | 118 public final Collection<Probe> findProbesTaggedAs(SyntaxTag tag) { |
126 return probeManager.findProbesTaggedAs(tag); | 119 return probeManager.findProbesTaggedAs(tag); |
127 } | |
128 | |
129 /** | |
130 * Returns all existing probes with first character on a specified line; empty collection if no | |
131 * probes found. | |
132 */ | |
133 public final Collection<Probe> findProbesByLine(LineLocation lineLocation) { | |
134 return probeManager.findProbesByLine(lineLocation); | |
135 } | 120 } |
136 | 121 |
137 /** | 122 /** |
138 * Sets a trap that will make a callback at any AST location where a existing probe holds a | 123 * Sets a trap that will make a callback at any AST location where a existing probe holds a |
139 * specified tag; only one trap may be set at a time. | 124 * specified tag; only one trap may be set at a time. |