changeset 16181:da146f137cf7

Truffle/Instrumentation: add method boolean ExecutionContext.hasProbe(SourceSection)
author Michael Van De Vanter <michael.van.de.vanter@oracle.com>
date Tue, 24 Jun 2014 09:35:18 -0700
parents 404d2e86488a
children 0a7e9347f8d0
files graal/com.oracle.truffle.api/src/com/oracle/truffle/api/ExecutionContext.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/impl/ProbeManager.java
diffstat 2 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/ExecutionContext.java	Tue Jun 24 13:12:26 2014 +0200
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/ExecutionContext.java	Tue Jun 24 09:35:18 2014 -0700
@@ -109,6 +109,16 @@
     }
 
     /**
+     * Has a {@link Probe} been created that is uniquely associated with a particular source code
+     * location.
+     *
+     * @return a probe uniquely associated with an extent of guest language source code.
+     */
+    public final boolean hasProbe(SourceSection sourceSection) {
+        return probeManager.hasProbe(sourceSection);
+    }
+
+    /**
      * Returns all existing probes with specific tag, or all probes if {@code tag = null}; empty
      * collection if no probes found.
      */
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/impl/ProbeManager.java	Tue Jun 24 13:12:26 2014 +0200
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/impl/ProbeManager.java	Tue Jun 24 09:35:18 2014 -0700
@@ -119,6 +119,11 @@
         return probe;
     }
 
+    public boolean hasProbe(SourceSection sourceSection) {
+        assert sourceSection != null;
+        return srcToProbe.get(sourceSection) != null;
+    }
+
     public Collection<Probe> findProbesTaggedAs(PhylumTag tag) {
         final List<Probe> probes = new ArrayList<>();
         for (Probe probe : srcToProbe.values()) {