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 7585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7596 SetValue(instr, instr->value()->definition()->constant_value()); | 7596 SetValue(instr, instr->value()->definition()->constant_value()); |
7597 } | 7597 } |
7598 | 7598 |
7599 | 7599 |
7600 void ConstantPropagator::VisitStoreInstanceField( | 7600 void ConstantPropagator::VisitStoreInstanceField( |
7601 StoreInstanceFieldInstr* instr) { | 7601 StoreInstanceFieldInstr* instr) { |
7602 SetValue(instr, instr->value()->definition()->constant_value()); | 7602 SetValue(instr, instr->value()->definition()->constant_value()); |
7603 } | 7603 } |
7604 | 7604 |
7605 | 7605 |
| 7606 void ConstantPropagator::VisitInitStaticField(InitStaticFieldInstr* instr) { |
| 7607 // Nothing to do. |
| 7608 } |
| 7609 |
| 7610 |
7606 void ConstantPropagator::VisitLoadStaticField(LoadStaticFieldInstr* instr) { | 7611 void ConstantPropagator::VisitLoadStaticField(LoadStaticFieldInstr* instr) { |
7607 const Field& field = instr->StaticField(); | 7612 const Field& field = instr->StaticField(); |
7608 ASSERT(field.is_static()); | 7613 ASSERT(field.is_static()); |
7609 if (field.is_final()) { | 7614 if (field.is_final()) { |
7610 Instance& obj = Instance::Handle(I, field.value()); | 7615 Instance& obj = Instance::Handle(I, field.value()); |
7611 ASSERT(obj.raw() != Object::sentinel().raw()); | 7616 ASSERT(obj.raw() != Object::sentinel().raw()); |
7612 ASSERT(obj.raw() != Object::transition_sentinel().raw()); | 7617 ASSERT(obj.raw() != Object::transition_sentinel().raw()); |
7613 if (obj.IsSmi() || obj.IsOld()) { | 7618 if (obj.IsSmi() || obj.IsOld()) { |
7614 SetValue(instr, obj); | 7619 SetValue(instr, obj); |
7615 return; | 7620 return; |
(...skipping 1943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9559 | 9564 |
9560 // Insert materializations at environment uses. | 9565 // Insert materializations at environment uses. |
9561 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { | 9566 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { |
9562 CreateMaterializationAt( | 9567 CreateMaterializationAt( |
9563 exits_collector_.exits()[i], alloc, alloc->cls(), *slots); | 9568 exits_collector_.exits()[i], alloc, alloc->cls(), *slots); |
9564 } | 9569 } |
9565 } | 9570 } |
9566 | 9571 |
9567 | 9572 |
9568 } // namespace dart | 9573 } // namespace dart |
OLD | NEW |