comparison graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/SpecializationData.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 a069a87b9a02
children 08aa0372dad4
comparison
equal deleted inserted replaced
18775:a069a87b9a02 18776:c0fb70634640
282 @Override 282 @Override
283 public String toString() { 283 public String toString() {
284 return String.format("%s [id = %s, method = %s, guards = %s, signature = %s]", getClass().getSimpleName(), getId(), getMethod(), getGuards(), getTypeSignature()); 284 return String.format("%s [id = %s, method = %s, guards = %s, signature = %s]", getClass().getSimpleName(), getId(), getMethod(), getGuards(), getTypeSignature());
285 } 285 }
286 286
287 public boolean isFrameUsedByGuard(ProcessorContext context) { 287 public boolean isFrameUsedByGuard() {
288 for (GuardExpression guard : getGuards()) { 288 for (GuardExpression guard : getGuards()) {
289 if (guard.getResolvedGuard() == null) { 289 if (guard.getResolvedGuard() == null) {
290 continue; 290 continue;
291 } 291 }
292 292
293 for (Parameter param : guard.getResolvedGuard().getParameters()) { 293 for (Parameter param : guard.getResolvedGuard().getParameters()) {
294 if (ElementUtils.typeEquals(param.getType(), context.getTruffleTypes().getFrame())) { 294 if (ElementUtils.typeEquals(param.getType(), getNode().getFrameType())) {
295 return true; 295 return true;
296 } 296 }
297 } 297 }
298 } 298 }
299 299