Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/TypeSystemCodeGenerator.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 | 23415229349b |
children | 1acaa69ff61b |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/TypeSystemCodeGenerator.java Wed Aug 13 18:06:18 2014 +0200 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/TypeSystemCodeGenerator.java Wed Aug 13 18:06:26 2014 +0200 @@ -87,20 +87,21 @@ clazz.add(singleton); for (TypeData type : typeSystem.getTypes()) { - if (!type.isGeneric()) { - clazz.addOptional(createIsTypeMethod(type)); - clazz.addOptional(createAsTypeMethod(type)); + if (type.isGeneric() || type.isVoid()) { + continue; + } + clazz.addOptional(createIsTypeMethod(type)); + clazz.addOptional(createAsTypeMethod(type)); - for (TypeData sourceType : collectExpectSourceTypes(type)) { - clazz.addOptional(createExpectTypeMethod(type, sourceType)); - } + for (TypeData sourceType : collectExpectSourceTypes(type)) { + clazz.addOptional(createExpectTypeMethod(type, sourceType)); + } - clazz.addOptional(createAsImplicitTypeMethod(type, true)); - clazz.addOptional(createAsImplicitTypeMethod(type, false)); - clazz.addOptional(createIsImplicitTypeMethod(type, true)); - clazz.addOptional(createIsImplicitTypeMethod(type, false)); - clazz.addOptional(createGetTypeIndex(type)); - } + clazz.addOptional(createAsImplicitTypeMethod(type, true)); + clazz.addOptional(createAsImplicitTypeMethod(type, false)); + clazz.addOptional(createIsImplicitTypeMethod(type, true)); + clazz.addOptional(createIsImplicitTypeMethod(type, false)); + clazz.addOptional(createGetTypeIndex(type)); } return clazz;