Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/template/ActualParameter.java @ 9217:61ba6fc21ba4
Sourcegen can now generate execute methods of signature execute(frame, evaluatedValue).
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 15 Apr 2013 18:50:19 +0200 |
parents | 5eeade940236 |
children | f43eb2f1bbbc |
comparison
equal
deleted
inserted
replaced
9216:8b9ea2f5c36e | 9217:61ba6fc21ba4 |
---|---|
27 import com.oracle.truffle.codegen.processor.typesystem.*; | 27 import com.oracle.truffle.codegen.processor.typesystem.*; |
28 | 28 |
29 public class ActualParameter { | 29 public class ActualParameter { |
30 | 30 |
31 private final ParameterSpec specification; | 31 private final ParameterSpec specification; |
32 private final TypeMirror actualType; | 32 private TypeData typeSystemType; |
33 private TemplateMethod method; | 33 private TemplateMethod method; |
34 private final String localName; | 34 private final String localName; |
35 private final int index; | 35 private final int index; |
36 private final boolean implicit; | 36 private final boolean implicit; |
37 private final TypeMirror type; | |
37 | 38 |
38 public ActualParameter(ParameterSpec specification, TypeMirror actualType, int index, boolean implicit) { | 39 public ActualParameter(ParameterSpec specification, TypeMirror actualType, int index, boolean implicit) { |
39 this.specification = specification; | 40 this.specification = specification; |
40 this.actualType = actualType; | 41 this.type = actualType; |
42 this.typeSystemType = null; | |
41 | 43 |
42 this.index = index; | 44 this.index = index; |
43 this.implicit = implicit; | 45 this.implicit = implicit; |
44 String valueName = specification.getName() + "Value"; | 46 String valueName = specification.getName() + "Value"; |
45 | 47 |
47 valueName += index; | 49 valueName += index; |
48 } | 50 } |
49 this.localName = valueName; | 51 this.localName = valueName; |
50 } | 52 } |
51 | 53 |
52 public ActualParameter(ActualParameter parameter, TypeMirror otherType) { | 54 public ActualParameter(ParameterSpec specification, TypeData actualType, int index, boolean implicit) { |
55 this(specification, actualType.getPrimitiveType(), index, implicit); | |
56 this.typeSystemType = actualType; | |
57 } | |
58 | |
59 public ActualParameter(ActualParameter parameter, TypeData otherType) { | |
53 this(parameter.specification, otherType, parameter.index, parameter.implicit); | 60 this(parameter.specification, otherType, parameter.index, parameter.implicit); |
54 } | 61 } |
55 | 62 |
56 public boolean isImplicit() { | 63 public boolean isImplicit() { |
57 return implicit; | 64 return implicit; |
75 | 82 |
76 public TemplateMethod getMethod() { | 83 public TemplateMethod getMethod() { |
77 return method; | 84 return method; |
78 } | 85 } |
79 | 86 |
80 public TypeMirror getActualType() { | 87 public TypeMirror getType() { |
81 return actualType; | 88 return type; |
82 } | 89 } |
83 | 90 |
84 public TypeData getActualTypeData(TypeSystemData typeSystem) { | 91 public TypeData getTypeSystemType() { |
85 return typeSystem.findTypeData(actualType); | 92 return typeSystemType; |
86 } | 93 } |
87 | 94 |
88 public ActualParameter getPreviousParameter() { | 95 public ActualParameter getPreviousParameter() { |
89 return method.getPreviousParam(this); | 96 return method.getPreviousParam(this); |
90 } | 97 } |