changeset 22236:df222c4e9bd9

Truffle/Instrumentaion: minor cleanup: Javadoc, an Instrumenter method is no longer public
author Michael Van De Vanter <michael.van.de.vanter@oracle.com>
date Mon, 21 Sep 2015 21:23:09 -0700
parents e110ab9f91fe
children c4e7737981d3
files truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/Accessor.java truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/Instrumenter.java
diffstat 2 files changed, 16 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/Accessor.java	Mon Sep 21 21:21:29 2015 -0700
+++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/Accessor.java	Mon Sep 21 21:23:09 2015 -0700
@@ -215,6 +215,9 @@
         throw new UnsupportedOperationException();
     }
 
+    /**
+     * Provided by each {@linkplain TruffleLanguage language implementation}.
+     */
     protected boolean isInstrumentable(Object vm, Node node) {
         final RootNode rootNode = node.getRootNode();
         Class<? extends TruffleLanguage> languageClazz = findLanguage(rootNode);
@@ -226,6 +229,9 @@
         return API.isInstrumentable(node, language);
     }
 
+    /**
+     * Provided by each {@linkplain TruffleLanguage language implementation}.
+     */
     protected WrapperNode createWrapperNode(Object vm, Node node) {
         final RootNode rootNode = node.getRootNode();
         Class<? extends TruffleLanguage> languageClazz = findLanguage(rootNode);
@@ -237,6 +243,9 @@
         return API.createWrapperNode(node, language);
     }
 
+    /**
+     * Provided by each {@linkplain TruffleLanguage language implementation}.
+     */
     protected ASTProber getDefaultASTProber(TruffleLanguage language) {
         return API.getDefaultASTProber(language);
     }
--- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/Instrumenter.java	Mon Sep 21 21:21:29 2015 -0700
+++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/Instrumenter.java	Mon Sep 21 21:23:09 2015 -0700
@@ -84,15 +84,14 @@
     }
 
     /**
-     * {@linkplain Instrument Instrumentation}-based tools that gather data during Guest Language
+     * {@linkplain Instrument Instrumentation}-based collectors of data during Guest Language
      * program execution.
      * <p>
      * Tools share a common <em>life cycle</em>:
      * <ul>
-     * <li>A newly created tool is inert until {@linkplain #install(Instrumenter) installed}.</li>
+     * <li>A newly created tool is inert until {@linkplain Instrumenter#install(Tool) installed}.</li>
      * <li>An installed tool becomes <em>enabled</em> and immediately begins installing
-     * {@linkplain Instrument instrumentation} on subsequently created ASTs and collecting data from
-     * those instruments</li>
+     * {@linkplain Instrument instrumentation} on ASTs and collecting execution data from them.</li>
      * <li>A tool may only be installed once.</li>
      * <li>It should be possible to install multiple instances of a tool, possibly (but not
      * necessarily) configured differently with respect to what data is being collected.</li>
@@ -118,10 +117,6 @@
      * <li>Return modification-safe representations of the data; and</li>
      * <li>Not change the state of the data.</li>
      * </ul>
-     * <b>Note:</b><br>
-     * Tool installation is currently <em>global</em> to the Truffle Execution environment. When
-     * language-agnostic management of individual execution environments is added to the platform,
-     * installation will be (optionally) specific to a single execution environment.
      */
     public abstract static class Tool<T extends Tool<?>> {
         // TODO (mlvdv) still thinking about the most appropriate name for this class of tools
@@ -288,21 +283,6 @@
     }
 
     /**
-     * For AST nodes that are {@linkplain #isInstrumentable() instrumentable}, returns a
-     * <em>wrapper node</em> that:
-     * <ol>
-     * <li>implements {@link WrapperNode}</li>
-     * <li>has the node as its single child, and</li>
-     * <li>whose type is safe for replacement of the node in the parent.</li>
-     * </ol>
-     *
-     * @return an appropriately typed {@link WrapperNode}
-     */
-    public WrapperNode createWrapperNode(Node node) {
-        return ACCESSOR.createWrapperNode(vm, node);
-    }
-
-    /**
      * Prepares an AST node for {@linkplain Instrument instrumentation}, where the node is presumed
      * to be part of a well-formed Truffle AST that has not yet been executed.
      * <p>
@@ -560,6 +540,10 @@
     void executionEnded() {
     }
 
+    WrapperNode createWrapperNode(Node node) {
+        return ACCESSOR.createWrapperNode(vm, node);
+    }
+
     void tagAdded(Probe probe, SyntaxTag tag, Object tagValue) {
         for (ProbeListener listener : probeListeners) {
             listener.probeTaggedAs(probe, tag, tagValue);