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/block_scheduler.h" | 5 #include "vm/block_scheduler.h" |
6 | 6 |
7 #include "vm/allocation.h" | 7 #include "vm/allocation.h" |
8 #include "vm/code_patcher.h" | 8 #include "vm/code_patcher.h" |
9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
10 #include "vm/flow_graph.h" | 10 #include "vm/flow_graph.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 void BlockScheduler::AssignEdgeWeights() const { | 55 void BlockScheduler::AssignEdgeWeights() const { |
56 if (!FLAG_reorder_basic_blocks) { | 56 if (!FLAG_reorder_basic_blocks) { |
57 return; | 57 return; |
58 } | 58 } |
59 | 59 |
60 const Array& ic_data_array = Array::Handle(flow_graph()->zone(), | 60 const Array& ic_data_array = Array::Handle(flow_graph()->zone(), |
61 flow_graph()->parsed_function().function().ic_data_array()); | 61 flow_graph()->parsed_function().function().ic_data_array()); |
62 if (Compiler::IsBackgroundCompilation() && ic_data_array.IsNull()) { | 62 if (Compiler::IsBackgroundCompilation() && ic_data_array.IsNull()) { |
63 // Deferred loading cleared ic_data_array. | 63 // Deferred loading cleared ic_data_array. |
64 Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId); | 64 Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId, |
| 65 "BlockScheduler: ICData array cleared"); |
65 } | 66 } |
66 ASSERT(!ic_data_array.IsNull()); | 67 ASSERT(!ic_data_array.IsNull()); |
67 Array& edge_counters = Array::Handle(); | 68 Array& edge_counters = Array::Handle(); |
68 edge_counters ^= ic_data_array.At(0); | 69 edge_counters ^= ic_data_array.At(0); |
69 | 70 |
70 intptr_t entry_count = GetEdgeCount( | 71 intptr_t entry_count = GetEdgeCount( |
71 edge_counters, | 72 edge_counters, |
72 flow_graph()->graph_entry()->normal_entry()->preorder_number()); | 73 flow_graph()->graph_entry()->normal_entry()->preorder_number()); |
73 flow_graph()->graph_entry()->set_entry_count(entry_count); | 74 flow_graph()->graph_entry()->set_entry_count(entry_count); |
74 | 75 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 for (intptr_t i = block_count - 1; i >= 0; --i) { | 209 for (intptr_t i = block_count - 1; i >= 0; --i) { |
209 if (chains[i]->first->block == flow_graph()->postorder()[i]) { | 210 if (chains[i]->first->block == flow_graph()->postorder()[i]) { |
210 for (Link* link = chains[i]->first; link != NULL; link = link->next) { | 211 for (Link* link = chains[i]->first; link != NULL; link = link->next) { |
211 flow_graph()->CodegenBlockOrder(true)->Add(link->block); | 212 flow_graph()->CodegenBlockOrder(true)->Add(link->block); |
212 } | 213 } |
213 } | 214 } |
214 } | 215 } |
215 } | 216 } |
216 | 217 |
217 } // namespace dart | 218 } // namespace dart |
OLD | NEW |