Mercurial > hg > truffle
comparison graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/ImplicitCastParser.java @ 16817: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 | 23415229349b |
children | 3912400fc33a |
comparison
equal
deleted
inserted
replaced
16816:8d374faacb7e | 16817:0370880ac9ce |
---|---|
43 return ImplicitCast.class; | 43 return ImplicitCast.class; |
44 } | 44 } |
45 | 45 |
46 @Override | 46 @Override |
47 public MethodSpec createSpecification(ExecutableElement method, AnnotationMirror mirror) { | 47 public MethodSpec createSpecification(ExecutableElement method, AnnotationMirror mirror) { |
48 List<TypeMirror> types = new ArrayList<>(); | 48 List<TypeMirror> types = getTypeSystem().getPrimitiveTypeMirrors(); |
49 for (TypeData typeData : getTypeSystem().getTypes()) { | 49 Set<String> identifiers = getTypeSystem().getTypeIdentifiers(); |
50 types.add(typeData.getPrimitiveType()); | 50 MethodSpec spec = new MethodSpec(new ParameterSpec("target", types, identifiers)); |
51 } | 51 spec.addRequired(new ParameterSpec("source", types, identifiers)); |
52 MethodSpec spec = new MethodSpec(new ParameterSpec("target", types)); | |
53 spec.addRequired(new ParameterSpec("source", types)); | |
54 return spec; | 52 return spec; |
55 } | 53 } |
56 | 54 |
57 @Override | 55 @Override |
58 public ImplicitCastData create(TemplateMethod method, boolean invalid) { | 56 public ImplicitCastData create(TemplateMethod method, boolean invalid) { |