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/cpu.h" | 9 #include "vm/cpu.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 7568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7579 SetValue(instr, instr->value()->definition()->constant_value()); | 7579 SetValue(instr, instr->value()->definition()->constant_value()); |
7580 } | 7580 } |
7581 | 7581 |
7582 | 7582 |
7583 void ConstantPropagator::VisitStoreInstanceField( | 7583 void ConstantPropagator::VisitStoreInstanceField( |
7584 StoreInstanceFieldInstr* instr) { | 7584 StoreInstanceFieldInstr* instr) { |
7585 SetValue(instr, instr->value()->definition()->constant_value()); | 7585 SetValue(instr, instr->value()->definition()->constant_value()); |
7586 } | 7586 } |
7587 | 7587 |
7588 | 7588 |
| 7589 void ConstantPropagator::VisitInitStaticField(InitStaticFieldInstr* instr) { |
| 7590 // Nothing to do. |
| 7591 } |
| 7592 |
| 7593 |
7589 void ConstantPropagator::VisitLoadStaticField(LoadStaticFieldInstr* instr) { | 7594 void ConstantPropagator::VisitLoadStaticField(LoadStaticFieldInstr* instr) { |
7590 const Field& field = instr->StaticField(); | 7595 const Field& field = instr->StaticField(); |
7591 ASSERT(field.is_static()); | 7596 ASSERT(field.is_static()); |
7592 if (field.is_final()) { | 7597 if (field.is_final()) { |
7593 Instance& obj = Instance::Handle(I, field.value()); | 7598 Instance& obj = Instance::Handle(I, field.value()); |
7594 ASSERT(obj.raw() != Object::sentinel().raw()); | 7599 ASSERT(obj.raw() != Object::sentinel().raw()); |
7595 ASSERT(obj.raw() != Object::transition_sentinel().raw()); | 7600 ASSERT(obj.raw() != Object::transition_sentinel().raw()); |
7596 if (obj.IsSmi() || obj.IsOld()) { | 7601 if (obj.IsSmi() || obj.IsOld()) { |
7597 SetValue(instr, obj); | 7602 SetValue(instr, obj); |
7598 return; | 7603 return; |
(...skipping 1943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9542 | 9547 |
9543 // Insert materializations at environment uses. | 9548 // Insert materializations at environment uses. |
9544 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { | 9549 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { |
9545 CreateMaterializationAt( | 9550 CreateMaterializationAt( |
9546 exits_collector_.exits()[i], alloc, alloc->cls(), *slots); | 9551 exits_collector_.exits()[i], alloc, alloc->cls(), *slots); |
9547 } | 9552 } |
9548 } | 9553 } |
9549 | 9554 |
9550 | 9555 |
9551 } // namespace dart | 9556 } // namespace dart |
OLD | NEW |