comparison graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/node/ExecutableTypeMethodParser.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 e4862151eefd
children e8ef44830b50
comparison
equal deleted inserted replaced
13483:37ec2cabf397 13527:25ecb47a6d0e
27 27
28 import javax.lang.model.element.*; 28 import javax.lang.model.element.*;
29 import javax.lang.model.type.*; 29 import javax.lang.model.type.*;
30 30
31 import com.oracle.truffle.dsl.processor.*; 31 import com.oracle.truffle.dsl.processor.*;
32 import com.oracle.truffle.dsl.processor.node.NodeChildData.*;
33 import com.oracle.truffle.dsl.processor.template.*; 32 import com.oracle.truffle.dsl.processor.template.*;
34 import com.oracle.truffle.dsl.processor.typesystem.*; 33 import com.oracle.truffle.dsl.processor.typesystem.*;
35 34
36 public class ExecutableTypeMethodParser extends NodeMethodParser<ExecutableTypeData> { 35 public class ExecutableTypeMethodParser extends NodeMethodParser<ExecutableTypeData> {
37 36
50 49
51 List<TypeMirror> allowedTypes = getNode().getTypeSystem().getPrimitiveTypeMirrors(); 50 List<TypeMirror> allowedTypes = getNode().getTypeSystem().getPrimitiveTypeMirrors();
52 for (ParameterSpec originalSpec : requiredSpecs) { 51 for (ParameterSpec originalSpec : requiredSpecs) {
53 spec.addRequired(new ParameterSpec(originalSpec, allowedTypes)); 52 spec.addRequired(new ParameterSpec(originalSpec, allowedTypes));
54 } 53 }
55 54 spec.setIgnoreAdditionalSpecifications(true);
56 spec.setVariableRequiredArguments(true); 55 spec.setIgnoreAdditionalParameters(true);
57 ParameterSpec other = new ParameterSpec("other", allowedTypes); 56 spec.setVariableRequiredParameters(true);
58 other.setCardinality(Cardinality.MANY); 57 // varargs
59 other.setSignature(true); 58 spec.addRequired(new ParameterSpec("other", allowedTypes));
60 other.setIndexed(true);
61 spec.addRequired(other);
62 return spec; 59 return spec;
63 } 60 }
64 61
65 @Override 62 @Override
66 public final boolean isParsable(ExecutableElement method) { 63 public final boolean isParsable(ExecutableElement method) {