diff graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/runtime/SLContext.java @ 16702:2a5ec181dad4

SL: Added instrumentation testing
author David Piorkowski <david.piorkowski@oracle.com>
date Tue, 05 Aug 2014 16:34:08 -0700
parents 618d92152d3c
children 7661cc464239
line wrap: on
line diff
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/runtime/SLContext.java	Tue Aug 05 22:00:12 2014 +0200
+++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/runtime/SLContext.java	Tue Aug 05 16:34:08 2014 -0700
@@ -138,6 +138,16 @@
         getFunctionRegistry().register(name, rootNode);
     }
 
+    /**
+     * This function will parse the given source code, parse the code using the {@link Parser}, and
+     * then execute the function named main. To use this method with instrumentation,
+     * setASTNodeProber must have been already called. There is currently no guard to check if this
+     * is the case. <br/>
+     * Due to the experimental nature of the instrumentation framework, the parse that happens in
+     * this method will remove any previously added instrumentation.
+     *
+     * @param source The {@link Source} to execute.
+     */
     public void executeMain(Source source) {
 
         if (sourceCallback != null) {
@@ -157,8 +167,12 @@
         main.getCallTarget().call();
     }
 
+    /**
+     * Sets the {@link SLASTProber} for the executeMain method.
+     *
+     * @param astProber The prober to use for adding instrumentation for this context.
+     */
     public void setASTNodeProber(SLASTProber astProber) {
-        // TODO Auto-generated method stub
         this.astProber = astProber;
     }
 }