comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/DefaultDebugManager.java @ 13733:4d47e9c0df23

Truffle/Instrumentation: Javadoc and cleanup
author Michael Van De Vanter <michael.van.de.vanter@oracle.com>
date Wed, 22 Jan 2014 20:28:52 -0800
parents fbf448929260
children
comparison
equal deleted inserted replaced
13732:fbf448929260 13733:4d47e9c0df23
30 import com.oracle.truffle.api.frame.*; 30 import com.oracle.truffle.api.frame.*;
31 import com.oracle.truffle.api.nodes.*; 31 import com.oracle.truffle.api.nodes.*;
32 import com.oracle.truffle.api.nodes.instrument.InstrumentationProbeNode.ProbeChain; 32 import com.oracle.truffle.api.nodes.instrument.InstrumentationProbeNode.ProbeChain;
33 import com.oracle.truffle.api.source.*; 33 import com.oracle.truffle.api.source.*;
34 34
35 public final class DefaultDebugManager implements DebugManager { 35 /**
36 * A minimal, language-agnostic implementation that tracks loaded sources, and keeps maps describing
37 * what locations in the source have instrumentation available.
38 */
39 public class DefaultDebugManager implements DebugManager {
36 40
37 private final Set<Source> loadedSources = new HashSet<>(); 41 private final Set<Source> loadedSources = new HashSet<>();
38 42
39 private Source beingLoaded = null; 43 private Source beingLoaded = null;
40 44
85 probeChains.add(probeChain); 89 probeChains.add(probeChain);
86 90
87 return probeChain; 91 return probeChain;
88 } 92 }
89 93
90 @Override
91 public void notifyStartLoading(Source source) { 94 public void notifyStartLoading(Source source) {
92 assert beingLoaded == null; 95 assert beingLoaded == null;
93 beingLoaded = source; 96 beingLoaded = source;
94 } 97 }
95 98
96 @Override
97 public void notifyFinishedLoading(Source source) { 99 public void notifyFinishedLoading(Source source) {
98 assert source == beingLoaded; 100 assert source == beingLoaded;
99 loadedSources.add(source); 101 loadedSources.add(source);
100 beingLoaded = null; 102 beingLoaded = null;
101 } 103 }