comparison graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/TruffleTypes.java @ 16755:bd28da642eea

Truffle-DSL: Several new features implemented: Implementation of a new code generation layout which shares code between generated nodes. Declaration order of specializations is now used as specialization order. Specializations do no longer perform fallthrough on respecialization, they now always respecialize from the first specialization. Implemented support for contains relations between specializations. Improved reachability error messages. Preliminary support for @Implies.
author Christian Humer <christian.humer@gmail.com>
date Mon, 11 Aug 2014 15:53:05 +0200
parents 915ebb306fcc
children 23415229349b
comparison
equal deleted inserted replaced
16754:55fd5be68a52 16755:bd28da642eea
30 30
31 import com.oracle.truffle.api.*; 31 import com.oracle.truffle.api.*;
32 import com.oracle.truffle.api.CompilerDirectives.CompilationFinal; 32 import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
33 import com.oracle.truffle.api.CompilerDirectives.SlowPath; 33 import com.oracle.truffle.api.CompilerDirectives.SlowPath;
34 import com.oracle.truffle.api.dsl.*; 34 import com.oracle.truffle.api.dsl.*;
35 import com.oracle.truffle.api.dsl.internal.*;
35 import com.oracle.truffle.api.frame.*; 36 import com.oracle.truffle.api.frame.*;
36 import com.oracle.truffle.api.nodes.*; 37 import com.oracle.truffle.api.nodes.*;
37 import com.oracle.truffle.api.nodes.Node.Child; 38 import com.oracle.truffle.api.nodes.Node.Child;
38 import com.oracle.truffle.api.nodes.Node.Children; 39 import com.oracle.truffle.api.nodes.Node.Children;
39 import com.oracle.truffle.api.source.*; 40 import com.oracle.truffle.api.source.*;
59 private final TypeMirror compilerAsserts; 60 private final TypeMirror compilerAsserts;
60 private final DeclaredType slowPath; 61 private final DeclaredType slowPath;
61 private final DeclaredType sourceSection; 62 private final DeclaredType sourceSection;
62 private final DeclaredType truffleOptions; 63 private final DeclaredType truffleOptions;
63 private final DeclaredType compilationFinal; 64 private final DeclaredType compilationFinal;
65 private final DeclaredType nodeUtil;
66 private final DeclaredType dslNode;
67 private final DeclaredType dslShare;
68 private final DeclaredType nodeFactory;
69 private final DeclaredType nodeFactoryBase;
70 private final DeclaredType dslMetadata;
71 private final DeclaredType implies;
64 private final TypeElement expectError; 72 private final TypeElement expectError;
65 73
66 private final List<String> errors = new ArrayList<>(); 74 private final List<String> errors = new ArrayList<>();
67 75
68 public TruffleTypes(ProcessorContext context) { 76 public TruffleTypes(ProcessorContext context) {
80 nodeCost = getRequired(context, NodeCost.class); 88 nodeCost = getRequired(context, NodeCost.class);
81 slowPath = getRequired(context, SlowPath.class); 89 slowPath = getRequired(context, SlowPath.class);
82 sourceSection = getRequired(context, SourceSection.class); 90 sourceSection = getRequired(context, SourceSection.class);
83 truffleOptions = getRequired(context, TruffleOptions.class); 91 truffleOptions = getRequired(context, TruffleOptions.class);
84 compilationFinal = getRequired(context, CompilationFinal.class); 92 compilationFinal = getRequired(context, CompilationFinal.class);
93 nodeUtil = getRequired(context, NodeUtil.class);
94 dslNode = getRequired(context, DSLNode.class);
95 dslShare = getRequired(context, DSLShare.class);
96 nodeFactory = getRequired(context, NodeFactory.class);
97 nodeFactoryBase = getRequired(context, NodeFactoryBase.class);
98 dslMetadata = getRequired(context, DSLMetadata.class);
99 implies = getRequired(context, Implies.class);
85 expectError = (TypeElement) getRequired(context, ExpectError.class).asElement(); 100 expectError = (TypeElement) getRequired(context, ExpectError.class).asElement();
101 }
102
103 public DeclaredType getImplies() {
104 return implies;
105 }
106
107 public DeclaredType getDslMetadata() {
108 return dslMetadata;
109 }
110
111 public DeclaredType getNodeFactory() {
112 return nodeFactory;
113 }
114
115 public DeclaredType getNodeFactoryBase() {
116 return nodeFactoryBase;
117 }
118
119 public DeclaredType getDslNode() {
120 return dslNode;
121 }
122
123 public DeclaredType getDslShare() {
124 return dslShare;
86 } 125 }
87 126
88 public DeclaredType getCompilationFinal() { 127 public DeclaredType getCompilationFinal() {
89 return compilationFinal; 128 return compilationFinal;
90 } 129 }
170 } 209 }
171 210
172 public DeclaredType getSourceSection() { 211 public DeclaredType getSourceSection() {
173 return sourceSection; 212 return sourceSection;
174 } 213 }
214
215 public DeclaredType getNodeUtil() {
216 return nodeUtil;
217 }
175 } 218 }