Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/model/NodeData.java @ 20945:1ed58a90b510
Truffle-DSL: fixed isFrameUsedByAnyGuard() was incomplete
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Tue, 14 Apr 2015 19:23:33 +0200 |
parents | 476374f3fe9a |
children | 56eb34a5aa22 |
comparison
equal
deleted
inserted
replaced
20944:354b7f1b4acf | 20945:1ed58a90b510 |
---|---|
141 public boolean isFrameUsedByAnyGuard() { | 141 public boolean isFrameUsedByAnyGuard() { |
142 for (SpecializationData specialization : specializations) { | 142 for (SpecializationData specialization : specializations) { |
143 if (!specialization.isReachable()) { | 143 if (!specialization.isReachable()) { |
144 continue; | 144 continue; |
145 } | 145 } |
146 if (specialization.isFrameUsed()) { | 146 Parameter frame = specialization.getFrame(); |
147 return true; | 147 if (frame != null) { |
148 for (GuardExpression guard : specialization.getGuards()) { | |
149 if (guard.getExpression().findBoundVariableElements().contains(frame.getVariableElement())) { | |
150 return true; | |
151 } | |
152 } | |
153 for (CacheExpression cache : specialization.getCaches()) { | |
154 if (cache.getExpression().findBoundVariableElements().contains(frame.getVariableElement())) { | |
155 return true; | |
156 } | |
157 } | |
148 } | 158 } |
149 } | 159 } |
150 return false; | 160 return false; |
151 } | 161 } |
152 | 162 |