diff graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/AdvancedInstrumentRootFactory.java @ 21355:442b57a7f208

Truffle/Instrumentation: change the signature for creation of Advanced instruments, refactor how the callback listener is managed.
author Michael Van De Vanter <michael.van.de.vanter@oracle.com>
date Tue, 12 May 2015 16:06:00 -0700
parents 575032310b2c
children e34bc00733d1
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/AdvancedInstrumentRootFactory.java	Tue May 12 14:48:33 2015 -0700
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/AdvancedInstrumentRootFactory.java	Tue May 12 16:06:00 2015 -0700
@@ -29,14 +29,13 @@
 /**
  * Creator of {@linkplain AdvancedInstrumentRoot AST fragments} suitable for efficient execution,
  * subject to full Truffle optimization, by an
- * {@linkplain Instrument#create(AdvancedInstrumentRootFactory, String) Advanced Instrument}.
+ * {@linkplain Instrument#create(AdvancedInstrumentResultListener, AdvancedInstrumentRootFactory, String)
+ * Advanced Instrument}.
  *
  * @see Instrument
  * @see AdvancedInstrumentRoot
  */
-public abstract class AdvancedInstrumentRootFactory {
-
-    private final AdvancedInstrumentResultListener resultListener;
+public interface AdvancedInstrumentRootFactory {
 
     /**
      * Provider of {@linkplain AdvancedInstrumentRoot AST fragment} instances for efficient
@@ -49,17 +48,5 @@
      * @return a newly created AST fragment suitable for execution, via instrumentation, in the
      *         execution context of the specified guest-language AST site.
      */
-    public abstract AdvancedInstrumentRoot createInstrumentRoot(Probe probe, Node node);
-
-    /**
-     * Gets the listener, if one was specified, to notify with the result of executing every
-     * {@link AdvancedInstrumentRoot} created by this factory.
-     */
-    public final AdvancedInstrumentResultListener resultListener() {
-        return resultListener;
-    }
-
-    protected AdvancedInstrumentRootFactory(AdvancedInstrumentResultListener resultListener) {
-        this.resultListener = resultListener;
-    }
+    AdvancedInstrumentRoot createInstrumentRoot(Probe probe, Node node);
 }