Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/SpecializationData.java @ 17251:6ee7afea175a
Truffle-DSL: Fixed @SlowPath was not applied to certain specialize0 implementations. This will reduce the pressure on the truffle cache.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 29 Sep 2014 18:37:24 +0200 |
parents | 89f635cbd85e |
children | a665483c3881 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/SpecializationData.java Mon Sep 29 18:37:24 2014 +0200 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/SpecializationData.java Mon Sep 29 18:37:24 2014 +0200 @@ -287,12 +287,19 @@ return String.format("%s [id = %s, method = %s, guards = %s, signature = %s]", getClass().getSimpleName(), getId(), getMethod(), getGuards(), getTypeSignature()); } - public boolean hasFrame(ProcessorContext context) { - for (Parameter param : getParameters()) { - if (ElementUtils.typeEquals(param.getType(), context.getTruffleTypes().getFrame())) { - return true; + public boolean isFrameUsedByGuard(ProcessorContext context) { + for (GuardExpression guard : getGuards()) { + if (guard.getResolvedGuard() == null) { + continue; + } + + for (Parameter param : guard.getResolvedGuard().getParameters()) { + if (ElementUtils.typeEquals(param.getType(), context.getTruffleTypes().getFrame())) { + return true; + } } } + return false; }