Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/TypeSystemParser.java @ 16820:0370880ac9ce
Truffle-DSL: better caching for type checks.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Wed, 13 Aug 2014 18:06:26 +0200 |
parents | e6d15134ca86 |
children | 93e061157811 |
comparison
equal
deleted
inserted
replaced
16819:8d374faacb7e | 16820:0370880ac9ce |
---|---|
65 } | 65 } |
66 if (typeSystem.hasErrors()) { | 66 if (typeSystem.hasErrors()) { |
67 return typeSystem; | 67 return typeSystem; |
68 } | 68 } |
69 | 69 |
70 typeSystem.setTypes(parseTypes(typeSystem)); | 70 List<TypeData> types = parseTypes(typeSystem); |
71 | |
72 TypeMirror genericType = context.getType(Object.class); | |
73 TypeData voidType = new TypeData(typeSystem, types.size(), null, context.getType(void.class), context.getType(Void.class)); | |
74 types.add(voidType); | |
75 | |
76 typeSystem.setTypes(types); | |
71 if (typeSystem.hasErrors()) { | 77 if (typeSystem.hasErrors()) { |
72 return typeSystem; | 78 return typeSystem; |
73 } | 79 } |
74 | |
75 TypeMirror genericType = context.getType(Object.class); | |
76 TypeData voidType = new TypeData(typeSystem, typeSystem.getTypes().size(), null, context.getType(void.class), context.getType(Void.class)); | |
77 | 80 |
78 typeSystem.setGenericType(genericType); | 81 typeSystem.setGenericType(genericType); |
79 typeSystem.setVoidType(voidType); | 82 typeSystem.setVoidType(voidType); |
80 | 83 |
81 verifyExclusiveMethodAnnotation(typeSystem, TypeCast.class, TypeCheck.class); | 84 verifyExclusiveMethodAnnotation(typeSystem, TypeCast.class, TypeCheck.class); |
196 } | 199 } |
197 | 200 |
198 verifyTypeOrder(types); | 201 verifyTypeOrder(types); |
199 | 202 |
200 types.add(new TypeData(typeSystem, index, annotationValue, objectType, objectType)); | 203 types.add(new TypeData(typeSystem, index, annotationValue, objectType, objectType)); |
201 | |
202 return types; | 204 return types; |
203 } | 205 } |
204 | 206 |
205 private static void verifyTypeOrder(List<TypeData> types) { | 207 private static void verifyTypeOrder(List<TypeData> types) { |
206 Map<String, List<String>> invalidTypes = new HashMap<>(); | 208 Map<String, List<String>> invalidTypes = new HashMap<>(); |