Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/template/ActualParameter.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 | 85b485b1e8e1 |
comparison
equal
deleted
inserted
replaced
13483:37ec2cabf397 | 13527:25ecb47a6d0e |
---|---|
31 | 31 |
32 private final ParameterSpec specification; | 32 private final ParameterSpec specification; |
33 private TypeData typeSystemType; | 33 private TypeData typeSystemType; |
34 private TemplateMethod method; | 34 private TemplateMethod method; |
35 private final String localName; | 35 private final String localName; |
36 private final int specificationIndex; | 36 private final int specificationVarArgsIndex; |
37 private final int varArgsIndex; | 37 private final int typeVarArgsIndex; |
38 private final boolean implicit; | 38 private final boolean implicit; |
39 private final TypeMirror type; | 39 private final TypeMirror actualType; |
40 | 40 |
41 public ActualParameter(ParameterSpec specification, TypeMirror actualType, int specificationIndex, int varArgsIndex, boolean implicit) { | 41 public ActualParameter(ParameterSpec specification, TypeMirror actualType, int specificationVarArgsIndex, int typeVarArgsIndex, boolean implicit) { |
42 this.specification = specification; | 42 this.specification = specification; |
43 this.type = actualType; | 43 this.actualType = actualType; |
44 this.typeSystemType = null; | 44 this.typeSystemType = null; |
45 | 45 |
46 this.specificationIndex = specificationIndex; | 46 this.specificationVarArgsIndex = specificationVarArgsIndex; |
47 this.implicit = implicit; | 47 this.implicit = implicit; |
48 | |
48 String valueName = specification.getName() + "Value"; | 49 String valueName = specification.getName() + "Value"; |
49 | 50 if (specificationVarArgsIndex > -1) { |
50 if (specification.isIndexed()) { | 51 valueName += "_" + specificationVarArgsIndex; |
51 valueName += specificationIndex; | |
52 } | 52 } |
53 this.varArgsIndex = varArgsIndex; | 53 this.typeVarArgsIndex = typeVarArgsIndex; |
54 this.localName = valueName; | 54 this.localName = valueName; |
55 } | 55 } |
56 | 56 |
57 public ActualParameter(ParameterSpec specification, TypeData actualType, int specificationIndex, int varArgsIndex, boolean implicit) { | 57 public ActualParameter(ParameterSpec specification, TypeData actualType, int specificationIndex, int varArgsIndex, boolean implicit) { |
58 this(specification, actualType.getPrimitiveType(), specificationIndex, varArgsIndex, implicit); | 58 this(specification, actualType.getPrimitiveType(), specificationIndex, varArgsIndex, implicit); |
59 this.typeSystemType = actualType; | 59 this.typeSystemType = actualType; |
60 } | 60 } |
61 | 61 |
62 public ActualParameter(ActualParameter parameter, TypeData otherType) { | 62 public ActualParameter(ActualParameter parameter, TypeData otherType) { |
63 this(parameter.specification, otherType, parameter.specificationIndex, parameter.varArgsIndex, parameter.implicit); | 63 this(parameter.specification, otherType, parameter.specificationVarArgsIndex, parameter.typeVarArgsIndex, parameter.implicit); |
64 } | 64 } |
65 | 65 |
66 public ActualParameter(ActualParameter parameter) { | 66 public ActualParameter(ActualParameter parameter) { |
67 this.specification = parameter.specification; | 67 this.specification = parameter.specification; |
68 this.type = parameter.type; | 68 this.actualType = parameter.actualType; |
69 this.typeSystemType = parameter.typeSystemType; | 69 this.typeSystemType = parameter.typeSystemType; |
70 this.specificationIndex = parameter.specificationIndex; | 70 this.specificationVarArgsIndex = parameter.specificationVarArgsIndex; |
71 this.implicit = parameter.implicit; | 71 this.implicit = parameter.implicit; |
72 this.localName = parameter.localName; | 72 this.localName = parameter.localName; |
73 this.varArgsIndex = parameter.varArgsIndex; | 73 this.typeVarArgsIndex = parameter.typeVarArgsIndex; |
74 } | 74 } |
75 | 75 |
76 public int getVarArgsIndex() { | 76 public int getTypeVarArgsIndex() { |
77 return varArgsIndex; | 77 return typeVarArgsIndex; |
78 } | 78 } |
79 | 79 |
80 public boolean isImplicit() { | 80 public boolean isImplicit() { |
81 return implicit; | 81 return implicit; |
82 } | 82 } |
83 | 83 |
84 public int getSpecificationIndex() { | 84 public int getSpecificationVarArgsIndex() { |
85 return specificationIndex; | 85 return specificationVarArgsIndex; |
86 } | 86 } |
87 | 87 |
88 public String getLocalName() { | 88 public String getLocalName() { |
89 return localName; | 89 return localName; |
90 } | 90 } |
100 public TemplateMethod getMethod() { | 100 public TemplateMethod getMethod() { |
101 return method; | 101 return method; |
102 } | 102 } |
103 | 103 |
104 public TypeMirror getType() { | 104 public TypeMirror getType() { |
105 return type; | 105 return actualType; |
106 } | 106 } |
107 | 107 |
108 public TypeData getTypeSystemType() { | 108 public TypeData getTypeSystemType() { |
109 return typeSystemType; | 109 return typeSystemType; |
110 } | 110 } |
111 | 111 |
112 public boolean isVarArgs() { | 112 public boolean isTypeVarArgs() { |
113 return varArgsIndex >= 0; | 113 return typeVarArgsIndex >= 0; |
114 } | 114 } |
115 | 115 |
116 public ActualParameter getPreviousParameter() { | 116 public ActualParameter getPreviousParameter() { |
117 return method.getPreviousParam(this); | 117 return method.getPreviousParam(this); |
118 } | 118 } |
119 | 119 |
120 @Override | 120 @Override |
121 public String toString() { | 121 public String toString() { |
122 return Utils.getSimpleName(type); | 122 return Utils.getSimpleName(actualType); |
123 } | 123 } |
124 } | 124 } |