| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/flow_graph_optimizer.h" | 5 #include "vm/flow_graph_optimizer.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/cha.h" | 8 #include "vm/cha.h" |
| 9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
| 10 #include "vm/flow_graph_builder.h" | 10 #include "vm/flow_graph_builder.h" |
| (...skipping 6199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6210 } | 6210 } |
| 6211 | 6211 |
| 6212 | 6212 |
| 6213 void ConstantPropagator::VisitStringFromCharCode( | 6213 void ConstantPropagator::VisitStringFromCharCode( |
| 6214 StringFromCharCodeInstr* instr) { | 6214 StringFromCharCodeInstr* instr) { |
| 6215 SetValue(instr, non_constant_); | 6215 SetValue(instr, non_constant_); |
| 6216 } | 6216 } |
| 6217 | 6217 |
| 6218 | 6218 |
| 6219 void ConstantPropagator::VisitStringInterpolate(StringInterpolateInstr* instr) { | 6219 void ConstantPropagator::VisitStringInterpolate(StringInterpolateInstr* instr) { |
| 6220 // TODO(srdjan): Remove the code below and enable constant folding once |
| 6221 // issue resolved. |
| 6222 SetValue(instr, non_constant_); |
| 6223 return; |
| 6224 |
| 6220 if (IsNonConstant(instr->constant_value())) { | 6225 if (IsNonConstant(instr->constant_value())) { |
| 6221 // Do not bother with costly analysis if we already know that the | 6226 // Do not bother with costly analysis if we already know that the |
| 6222 // instruction is not a constant. | 6227 // instruction is not a constant. |
| 6223 SetValue(instr, non_constant_); | 6228 SetValue(instr, non_constant_); |
| 6224 return; | 6229 return; |
| 6225 } | 6230 } |
| 6226 // If all inputs are constant strings, numbers, booleans or null, then | 6231 // If all inputs are constant strings, numbers, booleans or null, then |
| 6227 // constant fold. | 6232 // constant fold. |
| 6228 // TODO(srdjan): Also constant fold an interval of constant arguments. | 6233 // TODO(srdjan): Also constant fold an interval of constant arguments. |
| 6229 // v2 <- CreateArray(v0) | 6234 // v2 <- CreateArray(v0) |
| (...skipping 1518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7748 } | 7753 } |
| 7749 | 7754 |
| 7750 // Insert materializations at environment uses. | 7755 // Insert materializations at environment uses. |
| 7751 for (intptr_t i = 0; i < exits.length(); i++) { | 7756 for (intptr_t i = 0; i < exits.length(); i++) { |
| 7752 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *fields); | 7757 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *fields); |
| 7753 } | 7758 } |
| 7754 } | 7759 } |
| 7755 | 7760 |
| 7756 | 7761 |
| 7757 } // namespace dart | 7762 } // namespace dart |
| OLD | NEW |