OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/instruction.h" | 5 #include "src/compiler/instruction.h" |
6 #include "src/compiler/register-allocator-verifier.h" | 6 #include "src/compiler/register-allocator-verifier.h" |
7 | 7 |
8 namespace v8 { | 8 namespace v8 { |
9 namespace internal { | 9 namespace internal { |
10 namespace compiler { | 10 namespace compiler { |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 } | 269 } |
270 } | 270 } |
271 | 271 |
272 void RunParallelMoves(Zone* zone, const ParallelMove* move) { | 272 void RunParallelMoves(Zone* zone, const ParallelMove* move) { |
273 // Compute outgoing mappings. | 273 // Compute outgoing mappings. |
274 LocationMap to_insert((LocationMap::key_compare()), | 274 LocationMap to_insert((LocationMap::key_compare()), |
275 LocationMap::allocator_type(zone)); | 275 LocationMap::allocator_type(zone)); |
276 auto* moves = move->move_operands(); | 276 auto* moves = move->move_operands(); |
277 for (auto i = moves->begin(); i != moves->end(); ++i) { | 277 for (auto i = moves->begin(); i != moves->end(); ++i) { |
278 if (i->IsEliminated()) continue; | 278 if (i->IsEliminated()) continue; |
| 279 CHECK(i->source()->kind() != InstructionOperand::INVALID); |
279 auto cur = locations()->find(i->source()); | 280 auto cur = locations()->find(i->source()); |
280 CHECK(cur != locations()->end()); | 281 CHECK(cur != locations()->end()); |
| 282 if (i->destination()->kind() == InstructionOperand::INVALID) continue; |
281 to_insert.insert(std::make_pair(i->destination(), cur->second)); | 283 to_insert.insert(std::make_pair(i->destination(), cur->second)); |
282 } | 284 } |
283 // Drop current mappings. | 285 // Drop current mappings. |
284 for (auto i = moves->begin(); i != moves->end(); ++i) { | 286 for (auto i = moves->begin(); i != moves->end(); ++i) { |
285 if (i->IsEliminated()) continue; | 287 if (i->IsEliminated()) continue; |
286 auto cur = locations()->find(i->destination()); | 288 auto cur = locations()->find(i->destination()); |
287 if (cur != locations()->end()) locations()->erase(cur); | 289 if (cur != locations()->end()) locations()->erase(cur); |
288 } | 290 } |
289 // Insert new values. | 291 // Insert new values. |
290 locations()->insert(to_insert.begin(), to_insert.end()); | 292 locations()->insert(to_insert.begin(), to_insert.end()); |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 const auto* gap = GapInstruction::cast(instr); | 453 const auto* gap = GapInstruction::cast(instr); |
452 current->RunGapInstruction(zone(), gap); | 454 current->RunGapInstruction(zone(), gap); |
453 } | 455 } |
454 } | 456 } |
455 } | 457 } |
456 } | 458 } |
457 | 459 |
458 } // namespace compiler | 460 } // namespace compiler |
459 } // namespace internal | 461 } // namespace internal |
460 } // namespace v8 | 462 } // namespace v8 |
OLD | NEW |