Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/TypeSystemData.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 | 8169deda04bb |
children | 58eb9bbb60c4 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/TypeSystemData.java Wed Aug 13 18:06:18 2014 +0200 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/TypeSystemData.java Wed Aug 13 18:06:26 2014 +0200 @@ -60,6 +60,7 @@ primitiveTypeMirrors.add(typeData.getPrimitiveType()); boxedTypeMirrors.add(typeData.getBoxedType()); cachedTypes.put(ElementUtils.getUniqueIdentifier(typeData.getPrimitiveType()), typeData); + cachedTypes.put(ElementUtils.getUniqueIdentifier(typeData.getBoxedType()), typeData); } } } @@ -118,6 +119,10 @@ return primitiveTypeMirrors; } + public Set<String> getTypeIdentifiers() { + return cachedTypes.keySet(); + } + public List<TypeData> getTypes() { return types; } @@ -127,7 +132,7 @@ } public TypeData getGenericTypeData() { - TypeData result = types.get(types.size() - 1); + TypeData result = types.get(types.size() - 2); assert result.getBoxedType() == genericType; return result; }