diff graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/SLRootNode.java @ 16958:997899955e72

Instrumentation: removed ExecutionContext parameter from probe method in Instrumentable SL/Instrumentation: SLRootNode's now store SLContext. New method added to SLStatementNode to find the root node and get its SLContext
author David Piorkowski <david.piorkowski@oracle.com>
date Tue, 26 Aug 2014 11:00:30 -0700
parents 111bf82514ca
children 158c9ba66e45
line wrap: on
line diff
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/SLRootNode.java	Tue Aug 26 09:35:08 2014 -0700
+++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/SLRootNode.java	Tue Aug 26 11:00:30 2014 -0700
@@ -26,6 +26,7 @@
 import com.oracle.truffle.api.nodes.*;
 import com.oracle.truffle.sl.builtins.*;
 import com.oracle.truffle.sl.nodes.controlflow.*;
+import com.oracle.truffle.sl.runtime.*;
 
 /**
  * The root of all SL execution trees. It is a Truffle requirement that the tree root extends the
@@ -49,12 +50,16 @@
     /** The name of the function, for printing purposes only. */
     private final String name;
 
-    public SLRootNode(FrameDescriptor frameDescriptor, SLExpressionNode bodyNode, String name) {
+    /** The Simple execution context for this tree **/
+    private final SLContext context;
+
+    public SLRootNode(SLContext context, FrameDescriptor frameDescriptor, SLExpressionNode bodyNode, String name) {
         super(null, frameDescriptor);
         /* Deep copy the body before any specialization occurs during execution. */
         this.uninitializedBodyNode = NodeUtil.cloneNode(bodyNode);
         this.bodyNode = bodyNode;
         this.name = name;
+        this.context = context;
     }
 
     @Override
@@ -69,11 +74,15 @@
 
     @Override
     public RootNode split() {
-        return new SLRootNode(getFrameDescriptor().shallowCopy(), NodeUtil.cloneNode(uninitializedBodyNode), name);
+        return new SLRootNode(this.context, getFrameDescriptor().shallowCopy(), NodeUtil.cloneNode(uninitializedBodyNode), name);
     }
 
     @Override
     public String toString() {
         return "root " + name;
     }
+
+    public SLContext getSLContext() {
+        return this.context;
+    }
 }