Mercurial > hg > graal-compiler
annotate graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/template/ParameterSpec.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 | 8a1115c92271 |
children | 97ad6d3e7557 |
rev | line source |
---|---|
7291
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
1 /* |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
4 * |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
8 * |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
13 * accompanied this code). |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
14 * |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
18 * |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
21 * questions. |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
22 */ |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
23 package com.oracle.truffle.codegen.processor.template; |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
24 |
7502
6343a09b2ec1
Codegen operation generation is inferred from the node type hierarchy.
Christian Humer <christian.humer@gmail.com>
parents:
7291
diff
changeset
|
25 import java.util.*; |
6343a09b2ec1
Codegen operation generation is inferred from the node type hierarchy.
Christian Humer <christian.humer@gmail.com>
parents:
7291
diff
changeset
|
26 |
7291
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
27 import javax.lang.model.type.*; |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
28 |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
29 import com.oracle.truffle.codegen.processor.*; |
8595
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
30 import com.oracle.truffle.codegen.processor.template.MethodSpec.TypeDef; |
7291
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
31 |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
32 public class ParameterSpec { |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
33 |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
34 public enum Cardinality { |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
35 ONE, MULTIPLE; |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
36 } |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
37 |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
38 private final String name; |
8252
0905d796944a
Refactored codegen error model to make error redirection a lot easier.
Christian Humer <christian.humer@gmail.com>
parents:
8237
diff
changeset
|
39 private final List<TypeMirror> allowedTypes; |
8593
54e227b2e199
Refactored ParameterSpec constructors.
Christian Humer <christian.humer@gmail.com>
parents:
8592
diff
changeset
|
40 |
54e227b2e199
Refactored ParameterSpec constructors.
Christian Humer <christian.humer@gmail.com>
parents:
8592
diff
changeset
|
41 /** Cardinality one or multiple. */ |
8595
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
42 private Cardinality cardinality = Cardinality.ONE; |
8593
54e227b2e199
Refactored ParameterSpec constructors.
Christian Humer <christian.humer@gmail.com>
parents:
8592
diff
changeset
|
43 /** Type is part of the method signature. Relevant for comparisons. */ |
54e227b2e199
Refactored ParameterSpec constructors.
Christian Humer <christian.humer@gmail.com>
parents:
8592
diff
changeset
|
44 private boolean signature; |
54e227b2e199
Refactored ParameterSpec constructors.
Christian Humer <christian.humer@gmail.com>
parents:
8592
diff
changeset
|
45 /** Type must be indexed when parsing. */ |
8237
6b74ffe38183
Implemented support for executing nodes in @Children fields.
Christian Humer <christian.humer@gmail.com>
parents:
7794
diff
changeset
|
46 private boolean indexed; |
8593
54e227b2e199
Refactored ParameterSpec constructors.
Christian Humer <christian.humer@gmail.com>
parents:
8592
diff
changeset
|
47 /** Type is bound to local final variable. */ |
8310
89006c76f737
Final fields of base node can be optionally passed to builtin specialization method. And a few fixes.
Christian Humer <christian.humer@gmail.com>
parents:
8252
diff
changeset
|
48 private boolean local; |
7291
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
49 |
8595
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
50 private TypeDef typeDefinition; |
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
51 |
8593
54e227b2e199
Refactored ParameterSpec constructors.
Christian Humer <christian.humer@gmail.com>
parents:
8592
diff
changeset
|
52 public ParameterSpec(String name, TypeMirror... allowedTypes) { |
54e227b2e199
Refactored ParameterSpec constructors.
Christian Humer <christian.humer@gmail.com>
parents:
8592
diff
changeset
|
53 this(name, Arrays.asList(allowedTypes)); |
7291
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
54 } |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
55 |
8593
54e227b2e199
Refactored ParameterSpec constructors.
Christian Humer <christian.humer@gmail.com>
parents:
8592
diff
changeset
|
56 public ParameterSpec(String name, List<TypeMirror> allowedTypes) { |
54e227b2e199
Refactored ParameterSpec constructors.
Christian Humer <christian.humer@gmail.com>
parents:
8592
diff
changeset
|
57 this.name = name; |
54e227b2e199
Refactored ParameterSpec constructors.
Christian Humer <christian.humer@gmail.com>
parents:
8592
diff
changeset
|
58 this.allowedTypes = allowedTypes; |
7502
6343a09b2ec1
Codegen operation generation is inferred from the node type hierarchy.
Christian Humer <christian.humer@gmail.com>
parents:
7291
diff
changeset
|
59 } |
6343a09b2ec1
Codegen operation generation is inferred from the node type hierarchy.
Christian Humer <christian.humer@gmail.com>
parents:
7291
diff
changeset
|
60 |
8595
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
61 void setTypeDefinition(TypeDef typeDefinition) { |
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
62 this.typeDefinition = typeDefinition; |
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
63 } |
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
64 |
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
65 TypeDef getTypeDefinition() { |
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
66 return typeDefinition; |
7291
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
67 } |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
68 |
8593
54e227b2e199
Refactored ParameterSpec constructors.
Christian Humer <christian.humer@gmail.com>
parents:
8592
diff
changeset
|
69 public void setSignature(boolean signature) { |
54e227b2e199
Refactored ParameterSpec constructors.
Christian Humer <christian.humer@gmail.com>
parents:
8592
diff
changeset
|
70 this.signature = signature; |
7291
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
71 } |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
72 |
8310
89006c76f737
Final fields of base node can be optionally passed to builtin specialization method. And a few fixes.
Christian Humer <christian.humer@gmail.com>
parents:
8252
diff
changeset
|
73 public void setLocal(boolean local) { |
89006c76f737
Final fields of base node can be optionally passed to builtin specialization method. And a few fixes.
Christian Humer <christian.humer@gmail.com>
parents:
8252
diff
changeset
|
74 this.local = local; |
89006c76f737
Final fields of base node can be optionally passed to builtin specialization method. And a few fixes.
Christian Humer <christian.humer@gmail.com>
parents:
8252
diff
changeset
|
75 } |
89006c76f737
Final fields of base node can be optionally passed to builtin specialization method. And a few fixes.
Christian Humer <christian.humer@gmail.com>
parents:
8252
diff
changeset
|
76 |
8592
a80bf36c6a1e
Refactor to shared template method signature comparison.
Christian Humer <christian.humer@gmail.com>
parents:
8310
diff
changeset
|
77 public boolean isSignature() { |
a80bf36c6a1e
Refactor to shared template method signature comparison.
Christian Humer <christian.humer@gmail.com>
parents:
8310
diff
changeset
|
78 return signature; |
a80bf36c6a1e
Refactor to shared template method signature comparison.
Christian Humer <christian.humer@gmail.com>
parents:
8310
diff
changeset
|
79 } |
a80bf36c6a1e
Refactor to shared template method signature comparison.
Christian Humer <christian.humer@gmail.com>
parents:
8310
diff
changeset
|
80 |
8310
89006c76f737
Final fields of base node can be optionally passed to builtin specialization method. And a few fixes.
Christian Humer <christian.humer@gmail.com>
parents:
8252
diff
changeset
|
81 public boolean isLocal() { |
89006c76f737
Final fields of base node can be optionally passed to builtin specialization method. And a few fixes.
Christian Humer <christian.humer@gmail.com>
parents:
8252
diff
changeset
|
82 return local; |
89006c76f737
Final fields of base node can be optionally passed to builtin specialization method. And a few fixes.
Christian Humer <christian.humer@gmail.com>
parents:
8252
diff
changeset
|
83 } |
89006c76f737
Final fields of base node can be optionally passed to builtin specialization method. And a few fixes.
Christian Humer <christian.humer@gmail.com>
parents:
8252
diff
changeset
|
84 |
8237
6b74ffe38183
Implemented support for executing nodes in @Children fields.
Christian Humer <christian.humer@gmail.com>
parents:
7794
diff
changeset
|
85 public boolean isIndexed() { |
6b74ffe38183
Implemented support for executing nodes in @Children fields.
Christian Humer <christian.humer@gmail.com>
parents:
7794
diff
changeset
|
86 return indexed; |
6b74ffe38183
Implemented support for executing nodes in @Children fields.
Christian Humer <christian.humer@gmail.com>
parents:
7794
diff
changeset
|
87 } |
6b74ffe38183
Implemented support for executing nodes in @Children fields.
Christian Humer <christian.humer@gmail.com>
parents:
7794
diff
changeset
|
88 |
6b74ffe38183
Implemented support for executing nodes in @Children fields.
Christian Humer <christian.humer@gmail.com>
parents:
7794
diff
changeset
|
89 public void setIndexed(boolean indexed) { |
6b74ffe38183
Implemented support for executing nodes in @Children fields.
Christian Humer <christian.humer@gmail.com>
parents:
7794
diff
changeset
|
90 this.indexed = indexed; |
6b74ffe38183
Implemented support for executing nodes in @Children fields.
Christian Humer <christian.humer@gmail.com>
parents:
7794
diff
changeset
|
91 } |
6b74ffe38183
Implemented support for executing nodes in @Children fields.
Christian Humer <christian.humer@gmail.com>
parents:
7794
diff
changeset
|
92 |
6b74ffe38183
Implemented support for executing nodes in @Children fields.
Christian Humer <christian.humer@gmail.com>
parents:
7794
diff
changeset
|
93 public void setCardinality(Cardinality cardinality) { |
6b74ffe38183
Implemented support for executing nodes in @Children fields.
Christian Humer <christian.humer@gmail.com>
parents:
7794
diff
changeset
|
94 this.cardinality = cardinality; |
6b74ffe38183
Implemented support for executing nodes in @Children fields.
Christian Humer <christian.humer@gmail.com>
parents:
7794
diff
changeset
|
95 } |
6b74ffe38183
Implemented support for executing nodes in @Children fields.
Christian Humer <christian.humer@gmail.com>
parents:
7794
diff
changeset
|
96 |
8594
ce6e8672f798
Renamed node method parser base class.
Christian Humer <christian.humer@gmail.com>
parents:
8593
diff
changeset
|
97 public String getName() { |
7291
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
98 return name; |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
99 } |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
100 |
8594
ce6e8672f798
Renamed node method parser base class.
Christian Humer <christian.humer@gmail.com>
parents:
8593
diff
changeset
|
101 public Cardinality getCardinality() { |
7291
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
102 return cardinality; |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
103 } |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
104 |
8252
0905d796944a
Refactored codegen error model to make error redirection a lot easier.
Christian Humer <christian.humer@gmail.com>
parents:
8237
diff
changeset
|
105 public List<TypeMirror> getAllowedTypes() { |
7291
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
106 return allowedTypes; |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
107 } |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
108 |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
109 public boolean matches(TypeMirror actualType) { |
8252
0905d796944a
Refactored codegen error model to make error redirection a lot easier.
Christian Humer <christian.humer@gmail.com>
parents:
8237
diff
changeset
|
110 for (TypeMirror mirror : allowedTypes) { |
7291
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
111 if (Utils.typeEquals(actualType, mirror)) { |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
112 return true; |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
113 } |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
114 } |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
115 return false; |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
116 } |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
117 |
8595
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
118 @Override |
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
119 public String toString() { |
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
120 return toSignatureString(false); |
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
121 } |
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
122 |
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
123 public String toSignatureString(boolean typeOnly) { |
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
124 StringBuilder builder = new StringBuilder(); |
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
125 if (typeDefinition != null) { |
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
126 builder.append("<" + typeDefinition.getName() + ">"); |
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
127 } else if (getAllowedTypes().size() >= 1) { |
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
128 builder.append(Utils.getSimpleName(getAllowedTypes().get(0))); |
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
129 } else { |
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
130 builder.append("void"); |
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
131 } |
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
132 if (!typeOnly) { |
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
133 builder.append(" "); |
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
134 builder.append(getName()); |
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
135 } |
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
136 return builder.toString(); |
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
137 } |
8a1115c92271
Implemented codegen guard definitions can now omit unused parameters.
Christian Humer <christian.humer@gmail.com>
parents:
8594
diff
changeset
|
138 |
7291
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
139 } |