Mercurial > hg > graal-jvmci-8
comparison 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 |
comparison
equal
deleted
inserted
replaced
16819:8d374faacb7e | 16820:0370880ac9ce |
---|---|
85 clazz.add(createConstructorUsingFields(modifiers(PROTECTED), clazz)); | 85 clazz.add(createConstructorUsingFields(modifiers(PROTECTED), clazz)); |
86 CodeVariableElement singleton = createSingleton(clazz); | 86 CodeVariableElement singleton = createSingleton(clazz); |
87 clazz.add(singleton); | 87 clazz.add(singleton); |
88 | 88 |
89 for (TypeData type : typeSystem.getTypes()) { | 89 for (TypeData type : typeSystem.getTypes()) { |
90 if (!type.isGeneric()) { | 90 if (type.isGeneric() || type.isVoid()) { |
91 clazz.addOptional(createIsTypeMethod(type)); | 91 continue; |
92 clazz.addOptional(createAsTypeMethod(type)); | 92 } |
93 | 93 clazz.addOptional(createIsTypeMethod(type)); |
94 for (TypeData sourceType : collectExpectSourceTypes(type)) { | 94 clazz.addOptional(createAsTypeMethod(type)); |
95 clazz.addOptional(createExpectTypeMethod(type, sourceType)); | 95 |
96 } | 96 for (TypeData sourceType : collectExpectSourceTypes(type)) { |
97 | 97 clazz.addOptional(createExpectTypeMethod(type, sourceType)); |
98 clazz.addOptional(createAsImplicitTypeMethod(type, true)); | 98 } |
99 clazz.addOptional(createAsImplicitTypeMethod(type, false)); | 99 |
100 clazz.addOptional(createIsImplicitTypeMethod(type, true)); | 100 clazz.addOptional(createAsImplicitTypeMethod(type, true)); |
101 clazz.addOptional(createIsImplicitTypeMethod(type, false)); | 101 clazz.addOptional(createAsImplicitTypeMethod(type, false)); |
102 clazz.addOptional(createGetTypeIndex(type)); | 102 clazz.addOptional(createIsImplicitTypeMethod(type, true)); |
103 } | 103 clazz.addOptional(createIsImplicitTypeMethod(type, false)); |
104 clazz.addOptional(createGetTypeIndex(type)); | |
104 } | 105 } |
105 | 106 |
106 return clazz; | 107 return clazz; |
107 } | 108 } |
108 | 109 |