| 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/constant_propagator.h" | 5 #include "vm/constant_propagator.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/flow_graph_builder.h" | 8 #include "vm/flow_graph_builder.h" |
| 9 #include "vm/flow_graph_compiler.h" | 9 #include "vm/flow_graph_compiler.h" |
| 10 #include "vm/flow_graph_range_analysis.h" | 10 #include "vm/flow_graph_range_analysis.h" |
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 | 699 |
| 700 | 700 |
| 701 void ConstantPropagator::VisitInitStaticField(InitStaticFieldInstr* instr) { | 701 void ConstantPropagator::VisitInitStaticField(InitStaticFieldInstr* instr) { |
| 702 // Nothing to do. | 702 // Nothing to do. |
| 703 } | 703 } |
| 704 | 704 |
| 705 | 705 |
| 706 void ConstantPropagator::VisitLoadStaticField(LoadStaticFieldInstr* instr) { | 706 void ConstantPropagator::VisitLoadStaticField(LoadStaticFieldInstr* instr) { |
| 707 const Field& field = instr->StaticField(); | 707 const Field& field = instr->StaticField(); |
| 708 ASSERT(field.is_static()); | 708 ASSERT(field.is_static()); |
| 709 Instance& obj = Instance::Handle(I, field.value()); | 709 Instance& obj = Instance::Handle(I, field.StaticValue()); |
| 710 if (field.is_final() && (obj.raw() != Object::sentinel().raw()) && | 710 if (field.is_final() && (obj.raw() != Object::sentinel().raw()) && |
| 711 (obj.raw() != Object::transition_sentinel().raw())) { | 711 (obj.raw() != Object::transition_sentinel().raw())) { |
| 712 if (obj.IsSmi() || obj.IsOld()) { | 712 if (obj.IsSmi() || obj.IsOld()) { |
| 713 SetValue(instr, obj); | 713 SetValue(instr, obj); |
| 714 return; | 714 return; |
| 715 } | 715 } |
| 716 } | 716 } |
| 717 SetValue(instr, non_constant_); | 717 SetValue(instr, non_constant_); |
| 718 } | 718 } |
| 719 | 719 |
| (...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1679 graph_->MergeBlocks(); | 1679 graph_->MergeBlocks(); |
| 1680 GrowableArray<BitVector*> dominance_frontier; | 1680 GrowableArray<BitVector*> dominance_frontier; |
| 1681 graph_->ComputeDominators(&dominance_frontier); | 1681 graph_->ComputeDominators(&dominance_frontier); |
| 1682 | 1682 |
| 1683 if (FLAG_trace_constant_propagation) { | 1683 if (FLAG_trace_constant_propagation) { |
| 1684 FlowGraphPrinter::PrintGraph("After CP", graph_); | 1684 FlowGraphPrinter::PrintGraph("After CP", graph_); |
| 1685 } | 1685 } |
| 1686 } | 1686 } |
| 1687 | 1687 |
| 1688 } // namespace dart | 1688 } // namespace dart |
| OLD | NEW |