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/compiler.h" | 9 #include "vm/compiler.h" |
10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 4636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4647 if (FLAG_trace_optimization || FLAG_trace_field_guards) { | 4647 if (FLAG_trace_optimization || FLAG_trace_field_guards) { |
4648 THR_Print("Disabling unboxing of %s\n", field.ToCString()); | 4648 THR_Print("Disabling unboxing of %s\n", field.ToCString()); |
4649 if (!setter.IsNull()) { | 4649 if (!setter.IsNull()) { |
4650 OS::Print(" setter usage count: %" Pd "\n", setter.usage_counter()); | 4650 OS::Print(" setter usage count: %" Pd "\n", setter.usage_counter()); |
4651 } | 4651 } |
4652 if (!getter.IsNull()) { | 4652 if (!getter.IsNull()) { |
4653 OS::Print(" getter usage count: %" Pd "\n", getter.usage_counter()); | 4653 OS::Print(" getter usage count: %" Pd "\n", getter.usage_counter()); |
4654 } | 4654 } |
4655 } | 4655 } |
4656 field.set_is_unboxing_candidate(false); | 4656 field.set_is_unboxing_candidate(false); |
4657 // Delay deoptimization of dependent code to the code installation time. | 4657 if (Compiler::IsBackgroundCompilation()) { |
4658 // The invalidation of the background compilation result occurs only | 4658 // Delay deoptimization of dependent code to the code installation time. |
4659 // when the deoptimization is triggered at code installation. | 4659 // The invalidation of the background compilation result occurs only |
4660 flow_graph()->deoptimize_dependent_code().Add(&field); | 4660 // when the deoptimization is triggered at code installation. |
| 4661 flow_graph()->deoptimize_dependent_code().Add(&field); |
| 4662 } else { |
| 4663 field.DeoptimizeDependentCode(); |
| 4664 } |
4661 } else { | 4665 } else { |
4662 FlowGraph::AddToGuardedFields(flow_graph_->guarded_fields(), &field); | 4666 FlowGraph::AddToGuardedFields(flow_graph_->guarded_fields(), &field); |
4663 } | 4667 } |
4664 } | 4668 } |
4665 } | 4669 } |
4666 | 4670 |
4667 | 4671 |
4668 void FlowGraphOptimizer::VisitAllocateContext(AllocateContextInstr* instr) { | 4672 void FlowGraphOptimizer::VisitAllocateContext(AllocateContextInstr* instr) { |
4669 // Replace generic allocation with a sequence of inlined allocation and | 4673 // Replace generic allocation with a sequence of inlined allocation and |
4670 // explicit initalizing stores. | 4674 // explicit initalizing stores. |
(...skipping 4152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8823 | 8827 |
8824 // Insert materializations at environment uses. | 8828 // Insert materializations at environment uses. |
8825 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { | 8829 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { |
8826 CreateMaterializationAt( | 8830 CreateMaterializationAt( |
8827 exits_collector_.exits()[i], alloc, *slots); | 8831 exits_collector_.exits()[i], alloc, *slots); |
8828 } | 8832 } |
8829 } | 8833 } |
8830 | 8834 |
8831 | 8835 |
8832 } // namespace dart | 8836 } // namespace dart |
OLD | NEW |