diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/node/NodeData.java @ 13527:25ecb47a6d0e

Truffle-DSL: Added support for references to child arrays in @ShortCircuit; Introduced new layer NodeExecutionData to the implementation model which is in between NodeChildData and the actual parameters..
author Christian Humer <christian.humer@gmail.com>
date Tue, 07 Jan 2014 12:22:47 +0100
parents 2b9fcffd6f36
children 5a0c694ef735
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/node/NodeData.java	Thu Dec 26 12:37:28 2013 -0800
+++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/node/NodeData.java	Tue Jan 07 12:22:47 2014 +0100
@@ -28,7 +28,6 @@
 import javax.lang.model.type.*;
 
 import com.oracle.truffle.dsl.processor.*;
-import com.oracle.truffle.dsl.processor.node.NodeChildData.*;
 import com.oracle.truffle.dsl.processor.template.*;
 import com.oracle.truffle.dsl.processor.typesystem.*;
 
@@ -41,6 +40,7 @@
 
     private TypeSystemData typeSystem;
     private List<NodeChildData> children;
+    private List<NodeExecutionData> childExecutions;
     private List<NodeFieldData> fields;
     private TypeMirror nodeType;
     private ParameterSpec instanceParameterSpec;
@@ -78,6 +78,14 @@
         this.assumptions = splitSource.assumptions;
     }
 
+    public List<NodeExecutionData> getChildExecutions() {
+        return childExecutions;
+    }
+
+    void setChildExecutions(List<NodeExecutionData> signature) {
+        this.childExecutions = signature;
+    }
+
     public int getSignatureSize() {
         if (getSpecializations() != null && !getSpecializations().isEmpty()) {
             return getSpecializations().get(0).getSignatureSize();
@@ -374,16 +382,6 @@
         return result;
     }
 
-    public NodeChildData[] filterFields(ExecutionKind usage) {
-        List<NodeChildData> filteredFields = new ArrayList<>();
-        for (NodeChildData field : getChildren()) {
-            if (usage == null || field.getExecutionKind() == usage) {
-                filteredFields.add(field);
-            }
-        }
-        return filteredFields.toArray(new NodeChildData[filteredFields.size()]);
-    }
-
     public boolean needsRewrites(ProcessorContext context) {
         boolean needsRewrites = false;
 
@@ -490,6 +488,18 @@
         return b.toString();
     }
 
+    public NodeExecutionData findExecution(String name) {
+        if (getChildExecutions() == null) {
+            return null;
+        }
+        for (NodeExecutionData execution : getChildExecutions()) {
+            if (execution.getName().equals(name)) {
+                return execution;
+            }
+        }
+        return null;
+    }
+
     public NodeChildData findChild(String name) {
         for (NodeChildData field : getChildren()) {
             if (field.getName().equals(name)) {
@@ -593,4 +603,5 @@
     public int compareTo(NodeData o) {
         return getNodeId().compareTo(o.getNodeId());
     }
+
 }