Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/node/NodeChildData.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 | 2fb276f5e3e9 |
children | 5a0c694ef735 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/node/NodeChildData.java Thu Dec 26 12:37:28 2013 -0800 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/node/NodeChildData.java Tue Jan 07 12:22:47 2014 +0100 @@ -45,10 +45,6 @@ } } - public enum ExecutionKind { - DEFAULT, SHORT_CIRCUIT - } - private final NodeData parent; private final Element sourceElement; private final AnnotationMirror sourceAnnotationMirror; @@ -59,14 +55,13 @@ private final Element accessElement; private final Cardinality cardinality; - private final ExecutionKind executionKind; private List<NodeChildData> executeWith = Collections.emptyList(); private NodeData nodeData; public NodeChildData(NodeData parent, Element sourceElement, AnnotationMirror sourceMirror, String name, TypeMirror nodeType, TypeMirror originalNodeType, Element accessElement, - Cardinality cardinality, ExecutionKind executionKind) { + Cardinality cardinality) { this.parent = parent; this.sourceElement = sourceElement; this.sourceAnnotationMirror = sourceMirror; @@ -75,7 +70,6 @@ this.originalType = originalNodeType; this.accessElement = accessElement; this.cardinality = cardinality; - this.executionKind = executionKind; } public List<NodeChildData> getExecuteWith() { @@ -92,18 +86,12 @@ } boolean used = false; - SpecializationData generic = parent.getGenericSpecialization(); - for (ActualParameter param : generic.getParameters()) { - if (!param.getSpecification().isSignature()) { - continue; - } - NodeChildData child = parent.findChild(param.getSpecification().getName()); - if (child == this) { + for (NodeExecutionData execution : parent.getChildExecutions()) { + if (execution.getChild() == this) { used = true; break; } } - if (!used) { return false; } @@ -145,10 +133,6 @@ return sourceAnnotationMirror; } - public boolean isShortCircuit() { - return executionKind == ExecutionKind.SHORT_CIRCUIT; - } - void setNode(NodeData nodeData) { this.nodeData = nodeData; if (nodeData != null) { @@ -168,10 +152,6 @@ return cardinality; } - public ExecutionKind getExecutionKind() { - return executionKind; - } - public NodeData getNodeData() { return nodeData; } @@ -182,7 +162,7 @@ @Override public String toString() { - return "NodeFieldData[name=" + getName() + ", kind=" + cardinality + ", execution=" + executionKind + ", node=" + getNodeData() + "]"; + return "NodeFieldData[name=" + getName() + ", kind=" + cardinality + ", node=" + getNodeData() + "]"; } }