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/flow_graph.h" | 9 #include "vm/flow_graph.h" |
10 | 10 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 if (!FLAG_emit_edge_counters) { | 83 if (!FLAG_emit_edge_counters) { |
84 return; | 84 return; |
85 } | 85 } |
86 const Code& unoptimized_code = flow_graph()->parsed_function().code(); | 86 const Code& unoptimized_code = flow_graph()->parsed_function().code(); |
87 ASSERT(!unoptimized_code.IsNull()); | 87 ASSERT(!unoptimized_code.IsNull()); |
88 | 88 |
89 ZoneGrowableArray<uword>* deopt_id_pc_pairs = new ZoneGrowableArray<uword>(); | 89 ZoneGrowableArray<uword>* deopt_id_pc_pairs = new ZoneGrowableArray<uword>(); |
90 const PcDescriptors& descriptors = | 90 const PcDescriptors& descriptors = |
91 PcDescriptors::Handle(unoptimized_code.pc_descriptors()); | 91 PcDescriptors::Handle(unoptimized_code.pc_descriptors()); |
92 PcDescriptors::Iterator iter(descriptors, RawPcDescriptors::kDeopt); | 92 PcDescriptors::Iterator iter(descriptors, RawPcDescriptors::kDeopt); |
93 uword entry = | 93 uword entry = unoptimized_code.EntryPoint(); |
94 Instructions::Handle(unoptimized_code.instructions()).EntryPoint(); | |
95 while (iter.MoveNext()) { | 94 while (iter.MoveNext()) { |
96 intptr_t deopt_id = iter.DeoptId(); | 95 intptr_t deopt_id = iter.DeoptId(); |
97 ASSERT(deopt_id != Isolate::kNoDeoptId); | 96 ASSERT(deopt_id != Isolate::kNoDeoptId); |
98 uint32_t pc_offset = iter.PcOffset(); | 97 uint32_t pc_offset = iter.PcOffset(); |
99 deopt_id_pc_pairs->Add(static_cast<uword>(deopt_id)); | 98 deopt_id_pc_pairs->Add(static_cast<uword>(deopt_id)); |
100 deopt_id_pc_pairs->Add(entry + pc_offset); | 99 deopt_id_pc_pairs->Add(entry + pc_offset); |
101 } | 100 } |
102 | 101 |
103 intptr_t entry_count = | 102 intptr_t entry_count = |
104 ComputeEdgeCount(unoptimized_code, | 103 ComputeEdgeCount(unoptimized_code, |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 for (intptr_t i = block_count - 1; i >= 0; --i) { | 242 for (intptr_t i = block_count - 1; i >= 0; --i) { |
244 if (chains[i]->first->block == flow_graph()->postorder()[i]) { | 243 if (chains[i]->first->block == flow_graph()->postorder()[i]) { |
245 for (Link* link = chains[i]->first; link != NULL; link = link->next) { | 244 for (Link* link = chains[i]->first; link != NULL; link = link->next) { |
246 flow_graph()->CodegenBlockOrder(true)->Add(link->block); | 245 flow_graph()->CodegenBlockOrder(true)->Add(link->block); |
247 } | 246 } |
248 } | 247 } |
249 } | 248 } |
250 } | 249 } |
251 | 250 |
252 } // namespace dart | 251 } // namespace dart |
OLD | NEW |