comparison graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/TypeSystemData.java @ 16818:8169deda04bb

Truffle-DSL: introduced identifiers for type matching.
author Christian Humer <christian.humer@gmail.com>
date Wed, 13 Aug 2014 18:06:18 +0200
parents b8470fcec3a3
children 0370880ac9ce
comparison
equal deleted inserted replaced
16817:85c6e6fc3961 16818:8169deda04bb
57 this.types = types; 57 this.types = types;
58 if (types != null) { 58 if (types != null) {
59 for (TypeData typeData : types) { 59 for (TypeData typeData : types) {
60 primitiveTypeMirrors.add(typeData.getPrimitiveType()); 60 primitiveTypeMirrors.add(typeData.getPrimitiveType());
61 boxedTypeMirrors.add(typeData.getBoxedType()); 61 boxedTypeMirrors.add(typeData.getBoxedType());
62 cachedTypes.put(typeData.getPrimitiveType().toString(), typeData); 62 cachedTypes.put(ElementUtils.getUniqueIdentifier(typeData.getPrimitiveType()), typeData);
63 } 63 }
64 } 64 }
65 } 65 }
66 66
67 public void setImplicitCasts(List<ImplicitCastData> implicitCasts) { 67 public void setImplicitCasts(List<ImplicitCastData> implicitCasts) {
152 } 152 }
153 return types.get(index); 153 return types.get(index);
154 } 154 }
155 155
156 public int findType(TypeMirror type) { 156 public int findType(TypeMirror type) {
157 TypeData data = cachedTypes.get(type.toString()); 157 TypeData data = cachedTypes.get(ElementUtils.getUniqueIdentifier(type));
158 if (data != null) { 158 if (data != null) {
159 return data.getIndex(); 159 return data.getIndex();
160 } 160 }
161 return -1; 161 return -1;
162 } 162 }