Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/MethodParser.java @ 8237:6b74ffe38183
Implemented support for executing nodes in @Children fields.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Fri, 01 Mar 2013 17:03:57 +0100 |
parents | 6ad077b60cb3 |
children | 703c09f8640c |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/MethodParser.java Mon Feb 25 20:54:33 2013 +0100 +++ b/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/MethodParser.java Fri Mar 01 17:03:57 2013 +0100 @@ -27,7 +27,7 @@ import javax.lang.model.element.*; import com.oracle.truffle.codegen.processor.*; -import com.oracle.truffle.codegen.processor.node.NodeFieldData.ExecutionKind; +import com.oracle.truffle.codegen.processor.node.NodeFieldData.*; import com.oracle.truffle.codegen.processor.template.*; import com.oracle.truffle.codegen.processor.template.ParameterSpec.Cardinality; @@ -56,8 +56,11 @@ protected final MethodSpec createDefaultMethodSpec(String shortCircuitName) { List<ParameterSpec> defaultParameters = new ArrayList<>(); - ParameterSpec frameSpec = new ParameterSpec("frame", getContext().getTruffleTypes().getFrame(), true); - defaultParameters.add(frameSpec); + + if (getNode().supportsFrame()) { + ParameterSpec frameSpec = new ParameterSpec("frame", getContext().getTruffleTypes().getFrame(), true); + defaultParameters.add(frameSpec); + } for (NodeFieldData field : getNode().getFields()) { if (field.getExecutionKind() == ExecutionKind.IGNORE) { @@ -65,7 +68,12 @@ } if (field.getExecutionKind() == ExecutionKind.DEFAULT) { - defaultParameters.add(createValueParameterSpec(field.getName(), field.getNodeData(), false)); + ParameterSpec spec = createValueParameterSpec(field.getName(), field.getNodeData(), false); + if (field.getKind() == FieldKind.CHILDREN) { + spec.setCardinality(Cardinality.MULTIPLE); + spec.setIndexed(true); + } + defaultParameters.add(spec); } else if (field.getExecutionKind() == ExecutionKind.SHORT_CIRCUIT) { String valueName = field.getName(); if (shortCircuitName != null && valueName.equals(shortCircuitName)) {