| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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.h" | 5 #include "vm/flow_graph.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/flow_graph_builder.h" | 9 #include "vm/flow_graph_builder.h" |
| 10 #include "vm/flow_graph_compiler.h" | 10 #include "vm/flow_graph_compiler.h" |
| (...skipping 1822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1833 } | 1833 } |
| 1834 } | 1834 } |
| 1835 } | 1835 } |
| 1836 | 1836 |
| 1837 if (candidates.is_empty()) { | 1837 if (candidates.is_empty()) { |
| 1838 return; | 1838 return; |
| 1839 } | 1839 } |
| 1840 | 1840 |
| 1841 // Step 2. For each block in the graph compute which loop it belongs to. | 1841 // Step 2. For each block in the graph compute which loop it belongs to. |
| 1842 // We will use this information later during computation of the widening's | 1842 // We will use this information later during computation of the widening's |
| 1843 // gain: we are going to assume that only conversion occuring inside the | 1843 // gain: we are going to assume that only conversion occurring inside the |
| 1844 // same loop should be counted against the gain, all other conversions | 1844 // same loop should be counted against the gain, all other conversions |
| 1845 // can be hoisted and thus cost nothing compared to the loop cost itself. | 1845 // can be hoisted and thus cost nothing compared to the loop cost itself. |
| 1846 const ZoneGrowableArray<BlockEntryInstr*>& loop_headers = LoopHeaders(); | 1846 const ZoneGrowableArray<BlockEntryInstr*>& loop_headers = LoopHeaders(); |
| 1847 | 1847 |
| 1848 GrowableArray<intptr_t> loops(preorder().length()); | 1848 GrowableArray<intptr_t> loops(preorder().length()); |
| 1849 for (intptr_t i = 0; i < preorder().length(); i++) { | 1849 for (intptr_t i = 0; i < preorder().length(); i++) { |
| 1850 loops.Add(-1); | 1850 loops.Add(-1); |
| 1851 } | 1851 } |
| 1852 | 1852 |
| 1853 for (intptr_t loop_id = 0; loop_id < loop_headers.length(); ++loop_id) { | 1853 for (intptr_t loop_id = 0; loop_id < loop_headers.length(); ++loop_id) { |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2299 Representation rep, | 2299 Representation rep, |
| 2300 intptr_t cid) { | 2300 intptr_t cid) { |
| 2301 ExtractNthOutputInstr* extract = | 2301 ExtractNthOutputInstr* extract = |
| 2302 new (Z) ExtractNthOutputInstr(new (Z) Value(instr), index, rep, cid); | 2302 new (Z) ExtractNthOutputInstr(new (Z) Value(instr), index, rep, cid); |
| 2303 instr->ReplaceUsesWith(extract); | 2303 instr->ReplaceUsesWith(extract); |
| 2304 InsertAfter(instr, extract, NULL, FlowGraph::kValue); | 2304 InsertAfter(instr, extract, NULL, FlowGraph::kValue); |
| 2305 } | 2305 } |
| 2306 | 2306 |
| 2307 | 2307 |
| 2308 } // namespace dart | 2308 } // namespace dart |
| OLD | NEW |