Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/SpecializationData.java @ 19291:f4792a544170
Truffle-DSL: implement new assumptions semantics.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Wed, 11 Feb 2015 12:13:44 +0100 |
parents | 62c43fcf5be2 |
children | 21b9b9941775 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/SpecializationData.java Wed Feb 11 12:13:44 2015 +0100 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/SpecializationData.java Wed Feb 11 12:13:44 2015 +0100 @@ -46,7 +46,6 @@ private List<CacheExpression> caches = Collections.emptyList(); private List<AssumptionExpression> assumptionExpressions = Collections.emptyList(); private List<ShortCircuitData> shortCircuits; - private List<String> assumptions = Collections.emptyList(); private final Set<SpecializationData> contains = new TreeSet<>(); private final Set<String> containsNames = new TreeSet<>(); private final Set<SpecializationData> excludedBy = new TreeSet<>(); @@ -159,6 +158,9 @@ if (caches != null) { sinks.addAll(caches); } + if (assumptionExpressions != null) { + sinks.addAll(assumptionExpressions); + } return sinks; } @@ -169,7 +171,7 @@ if (!getGuards().isEmpty()) { return true; } - if (!getAssumptions().isEmpty()) { + if (!getAssumptionExpressions().isEmpty()) { return true; } @@ -260,14 +262,6 @@ return shortCircuits; } - public List<String> getAssumptions() { - return assumptions; - } - - public void setAssumptions(List<String> assumptions) { - this.assumptions = assumptions; - } - public SpecializationData findNextSpecialization() { List<SpecializationData> specializations = node.getSpecializations(); for (int i = 0; i < specializations.size() - 1; i++) { @@ -317,9 +311,7 @@ } } } - return false; - } public boolean isReachableAfter(SpecializationData prev) { @@ -349,10 +341,10 @@ } } - for (String prevAssumption : prev.getAssumptions()) { - if (!getAssumptions().contains(prevAssumption)) { - return true; - } + if (!prev.getAssumptionExpressions().isEmpty()) { + // TODO: chumer: we could at least check reachability after trivial assumptions + // not sure if this is worth it. + return true; } Iterator<GuardExpression> prevGuards = prev.getGuards().iterator();