| 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/flow_graph_builder.h" | 9 #include "vm/flow_graph_builder.h" |
| 10 #include "vm/flow_graph_compiler.h" | 10 #include "vm/flow_graph_compiler.h" |
| (...skipping 5680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5691 } | 5691 } |
| 5692 | 5692 |
| 5693 | 5693 |
| 5694 void ConstantPropagator::VisitEqualityCompare(EqualityCompareInstr* instr) { | 5694 void ConstantPropagator::VisitEqualityCompare(EqualityCompareInstr* instr) { |
| 5695 const Object& left = instr->left()->definition()->constant_value(); | 5695 const Object& left = instr->left()->definition()->constant_value(); |
| 5696 const Object& right = instr->right()->definition()->constant_value(); | 5696 const Object& right = instr->right()->definition()->constant_value(); |
| 5697 | 5697 |
| 5698 if (instr->left()->definition() == instr->right()->definition()) { | 5698 if (instr->left()->definition() == instr->right()->definition()) { |
| 5699 // Fold x == x, and x != x to true/false for numbers and checked strict | 5699 // Fold x == x, and x != x to true/false for numbers and checked strict |
| 5700 // comparisons. | 5700 // comparisons. |
| 5701 if (instr->is_checked_strict_equal() || | 5701 if (instr->IsCheckedStrictEqual() || |
| 5702 RawObject::IsIntegerClassId(instr->receiver_class_id())) { | 5702 RawObject::IsIntegerClassId(instr->receiver_class_id())) { |
| 5703 return SetValue(instr, | 5703 return SetValue(instr, |
| 5704 (instr->kind() == Token::kEQ) | 5704 (instr->kind() == Token::kEQ) |
| 5705 ? Bool::True() | 5705 ? Bool::True() |
| 5706 : Bool::False()); | 5706 : Bool::False()); |
| 5707 } | 5707 } |
| 5708 } | 5708 } |
| 5709 | 5709 |
| 5710 if (IsNonConstant(left) || IsNonConstant(right)) { | 5710 if (IsNonConstant(left) || IsNonConstant(right)) { |
| 5711 SetValue(instr, non_constant_); | 5711 SetValue(instr, non_constant_); |
| (...skipping 1417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7129 | 7129 |
| 7130 // Insert materializations at environment uses. | 7130 // Insert materializations at environment uses. |
| 7131 const Class& cls = Class::Handle(alloc->constructor().Owner()); | 7131 const Class& cls = Class::Handle(alloc->constructor().Owner()); |
| 7132 for (intptr_t i = 0; i < exits.length(); i++) { | 7132 for (intptr_t i = 0; i < exits.length(); i++) { |
| 7133 CreateMaterializationAt(exits[i], alloc, cls, *fields); | 7133 CreateMaterializationAt(exits[i], alloc, cls, *fields); |
| 7134 } | 7134 } |
| 7135 } | 7135 } |
| 7136 | 7136 |
| 7137 | 7137 |
| 7138 } // namespace dart | 7138 } // namespace dart |
| OLD | NEW |