Mercurial > hg > graal-compiler
diff graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/NodeFieldData.java @ 9220:97ad6d3e7557
Codegen API changes. Executed child nodes are now defined using @NodeChildren instead of fields.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Sat, 20 Apr 2013 12:16:22 +0200 |
parents | 61ba6fc21ba4 |
children |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/NodeFieldData.java Tue Apr 16 11:03:40 2013 +0200 +++ b/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/NodeFieldData.java Sat Apr 20 12:16:22 2013 +0200 @@ -29,88 +29,27 @@ public class NodeFieldData extends MessageContainer { - public enum FieldKind { - CHILD, CHILDREN, FINAL_FIELD - } - - public enum ExecutionKind { - DEFAULT, IGNORE, SHORT_CIRCUIT - } - - private final VariableElement fieldElement; - private final Element accessElement; - private final AnnotationMirror childAnnotationMirror; - - private final FieldKind fieldKind; - private final ExecutionKind executionKind; - private NodeData nodeData; + private VariableElement variable; - public NodeFieldData(VariableElement fieldElement, Element accessElement, AnnotationMirror childAnnotationMirror, FieldKind fieldKind, ExecutionKind executionKind) { - this.fieldElement = fieldElement; - this.accessElement = accessElement; - this.childAnnotationMirror = childAnnotationMirror; - this.fieldKind = fieldKind; - this.executionKind = executionKind; - } - - NodeFieldData(NodeFieldData field) { - this.fieldElement = field.fieldElement; - this.accessElement = field.accessElement; - this.childAnnotationMirror = field.childAnnotationMirror; - this.fieldKind = field.fieldKind; - this.executionKind = field.executionKind; - this.nodeData = field.nodeData; + public NodeFieldData(VariableElement var) { + this.variable = var; } @Override public Element getMessageElement() { - return fieldElement; - } - - public boolean isShortCircuit() { - return executionKind == ExecutionKind.SHORT_CIRCUIT; + return variable; } - void setNode(NodeData nodeData) { - this.nodeData = nodeData; - getMessages().addAll(nodeData.collectMessages()); - } - - public VariableElement getFieldElement() { - return fieldElement; - } - - public Element getAccessElement() { - return accessElement; - } - - public AnnotationMirror getChildAnnotationMirror() { - return childAnnotationMirror; + public String getName() { + return variable.getSimpleName().toString(); } public TypeMirror getType() { - return fieldElement.asType(); - } - - public FieldKind getKind() { - return fieldKind; - } - - public ExecutionKind getExecutionKind() { - return executionKind; + return variable.asType(); } - public NodeData getNodeData() { - return nodeData; - } - - public String getName() { - return fieldElement.getSimpleName().toString(); - } - - @Override - public String toString() { - return "NodeFieldData[name=" + getName() + ", kind=" + fieldKind + ", execution=" + executionKind + ", node=" + getNodeData() + "]"; + public VariableElement getVariable() { + return variable; } }