Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/TypeSystemCodeGenerator.java @ 18776:c0fb70634640
Truffle-DSL: support for frame types Frame, MaterializedFrame. Added validation for frame type consistency. Some refactorings along the way.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 05 Jan 2015 01:31:08 +0100 |
parents | a665483c3881 |
children | ae81dd154fb6 |
comparison
equal
deleted
inserted
replaced
18775:a069a87b9a02 | 18776:c0fb70634640 |
---|---|
116 builder.startStaticCall(typeSystem.getTemplateType().asType(), type.getTypeCasts().get(0).getMethodName()).tree(content).end(); | 116 builder.startStaticCall(typeSystem.getTemplateType().asType(), type.getTypeCasts().get(0).getMethodName()).tree(content).end(); |
117 } | 117 } |
118 return builder.build(); | 118 return builder.build(); |
119 } | 119 } |
120 | 120 |
121 public static CodeTree cast(TypeData sourceType, TypeData targetType, CodeTree content) { | |
122 if (sourceType != null && !sourceType.needsCastTo(targetType)) { | |
123 return content; | |
124 } else { | |
125 return cast(targetType, content); | |
126 } | |
127 } | |
128 | |
121 public static CodeTree expect(TypeData type, CodeTree content) { | 129 public static CodeTree expect(TypeData type, CodeTree content) { |
122 if (type.isGeneric() || type.isVoid()) { | 130 if (type.isGeneric() || type.isVoid()) { |
123 return content; | 131 return content; |
124 } | 132 } |
125 CodeTreeBuilder builder = CodeTreeBuilder.createBuilder(); | 133 CodeTreeBuilder builder = CodeTreeBuilder.createBuilder(); |