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 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1309 InsertAfter(prev, redef, NULL, FlowGraph::kValue); | 1309 InsertAfter(prev, redef, NULL, FlowGraph::kValue); |
1310 RenameDominatedUses(original, redef, redef); | 1310 RenameDominatedUses(original, redef, redef); |
1311 return redef; | 1311 return redef; |
1312 } | 1312 } |
1313 | 1313 |
1314 | 1314 |
1315 void FlowGraph::RemoveRedefinitions() { | 1315 void FlowGraph::RemoveRedefinitions() { |
1316 // Remove redefinition instructions inserted to inhibit hoisting. | 1316 // Remove redefinition instructions inserted to inhibit hoisting. |
1317 for (BlockIterator block_it = reverse_postorder_iterator(); !block_it.Done(); | 1317 for (BlockIterator block_it = reverse_postorder_iterator(); !block_it.Done(); |
1318 block_it.Advance()) { | 1318 block_it.Advance()) { |
| 1319 thread()->CheckForSafepoint(); |
1319 for (ForwardInstructionIterator instr_it(block_it.Current()); | 1320 for (ForwardInstructionIterator instr_it(block_it.Current()); |
1320 !instr_it.Done(); instr_it.Advance()) { | 1321 !instr_it.Done(); instr_it.Advance()) { |
1321 RedefinitionInstr* redefinition = instr_it.Current()->AsRedefinition(); | 1322 RedefinitionInstr* redefinition = instr_it.Current()->AsRedefinition(); |
1322 if (redefinition != NULL) { | 1323 if (redefinition != NULL) { |
1323 Definition* original; | 1324 Definition* original; |
1324 do { | 1325 do { |
1325 original = redefinition->value()->definition(); | 1326 original = redefinition->value()->definition(); |
1326 } while (original->IsRedefinition()); | 1327 } while (original->IsRedefinition()); |
1327 redefinition->ReplaceUsesWith(original); | 1328 redefinition->ReplaceUsesWith(original); |
1328 instr_it.RemoveCurrentFromGraph(); | 1329 instr_it.RemoveCurrentFromGraph(); |
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2299 Representation rep, | 2300 Representation rep, |
2300 intptr_t cid) { | 2301 intptr_t cid) { |
2301 ExtractNthOutputInstr* extract = | 2302 ExtractNthOutputInstr* extract = |
2302 new (Z) ExtractNthOutputInstr(new (Z) Value(instr), index, rep, cid); | 2303 new (Z) ExtractNthOutputInstr(new (Z) Value(instr), index, rep, cid); |
2303 instr->ReplaceUsesWith(extract); | 2304 instr->ReplaceUsesWith(extract); |
2304 InsertAfter(instr, extract, NULL, FlowGraph::kValue); | 2305 InsertAfter(instr, extract, NULL, FlowGraph::kValue); |
2305 } | 2306 } |
2306 | 2307 |
2307 | 2308 |
2308 } // namespace dart | 2309 } // namespace dart |
OLD | NEW |