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 = unoptimized_code.EntryPoint(); | 93 uword entry = |
| 94 Instructions::Handle(unoptimized_code.instructions()).EntryPoint(); |
94 while (iter.MoveNext()) { | 95 while (iter.MoveNext()) { |
95 intptr_t deopt_id = iter.DeoptId(); | 96 intptr_t deopt_id = iter.DeoptId(); |
96 ASSERT(deopt_id != Isolate::kNoDeoptId); | 97 ASSERT(deopt_id != Isolate::kNoDeoptId); |
97 uint32_t pc_offset = iter.PcOffset(); | 98 uint32_t pc_offset = iter.PcOffset(); |
98 deopt_id_pc_pairs->Add(static_cast<uword>(deopt_id)); | 99 deopt_id_pc_pairs->Add(static_cast<uword>(deopt_id)); |
99 deopt_id_pc_pairs->Add(entry + pc_offset); | 100 deopt_id_pc_pairs->Add(entry + pc_offset); |
100 } | 101 } |
101 | 102 |
102 intptr_t entry_count = | 103 intptr_t entry_count = |
103 ComputeEdgeCount(unoptimized_code, | 104 ComputeEdgeCount(unoptimized_code, |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 for (intptr_t i = block_count - 1; i >= 0; --i) { | 243 for (intptr_t i = block_count - 1; i >= 0; --i) { |
243 if (chains[i]->first->block == flow_graph()->postorder()[i]) { | 244 if (chains[i]->first->block == flow_graph()->postorder()[i]) { |
244 for (Link* link = chains[i]->first; link != NULL; link = link->next) { | 245 for (Link* link = chains[i]->first; link != NULL; link = link->next) { |
245 flow_graph()->CodegenBlockOrder(true)->Add(link->block); | 246 flow_graph()->CodegenBlockOrder(true)->Add(link->block); |
246 } | 247 } |
247 } | 248 } |
248 } | 249 } |
249 } | 250 } |
250 | 251 |
251 } // namespace dart | 252 } // namespace dart |
OLD | NEW |