| 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/bit-vector.h" | 5 #include "src/bit-vector.h" |
| 6 #include "src/compiler/instruction.h" | 6 #include "src/compiler/instruction.h" |
| 7 #include "src/compiler/register-allocator-verifier.h" | 7 #include "src/compiler/register-allocator-verifier.h" |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 int virtual_register) { | 462 int virtual_register) { |
| 463 if (assessment->virtual_register() == virtual_register) return; | 463 if (assessment->virtual_register() == virtual_register) return; |
| 464 // If we have 2 phis with the exact same operand list, and the first phi is | 464 // If we have 2 phis with the exact same operand list, and the first phi is |
| 465 // used before the second one, via the operand incoming to the block, | 465 // used before the second one, via the operand incoming to the block, |
| 466 // and the second one's operand is defined (via a parallel move) after the | 466 // and the second one's operand is defined (via a parallel move) after the |
| 467 // use, then the original operand will be assigned to the first phi. We | 467 // use, then the original operand will be assigned to the first phi. We |
| 468 // then look at the original pending assessment to ascertain if op | 468 // then look at the original pending assessment to ascertain if op |
| 469 // is virtual_register. | 469 // is virtual_register. |
| 470 const PendingAssessment* old = assessment->original_pending_assessment(); | 470 const PendingAssessment* old = assessment->original_pending_assessment(); |
| 471 CHECK_NOT_NULL(old); | 471 CHECK_NOT_NULL(old); |
| 472 ValidatePendingAssessment(block_id, op, current_assessments, old, | 472 RpoNumber old_block = old->origin()->rpo_number(); |
| 473 BlockAssessments* old_block_assessments = assessments_[old_block]; |
| 474 ValidatePendingAssessment(old_block, op, old_block_assessments, old, |
| 473 virtual_register); | 475 virtual_register); |
| 474 } | 476 } |
| 475 | 477 |
| 476 void RegisterAllocatorVerifier::ValidateUse( | 478 void RegisterAllocatorVerifier::ValidateUse( |
| 477 RpoNumber block_id, BlockAssessments* current_assessments, | 479 RpoNumber block_id, BlockAssessments* current_assessments, |
| 478 InstructionOperand op, int virtual_register) { | 480 InstructionOperand op, int virtual_register) { |
| 479 auto iterator = current_assessments->map().find(op); | 481 auto iterator = current_assessments->map().find(op); |
| 480 // We should have seen this operand before. | 482 // We should have seen this operand before. |
| 481 CHECK(iterator != current_assessments->map().end()); | 483 CHECK(iterator != current_assessments->map().end()); |
| 482 Assessment* assessment = iterator->second; | 484 Assessment* assessment = iterator->second; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 new (zone()) FinalAssessment(vreg, pending); | 573 new (zone()) FinalAssessment(vreg, pending); |
| 572 break; | 574 break; |
| 573 } | 575 } |
| 574 } | 576 } |
| 575 } | 577 } |
| 576 } | 578 } |
| 577 | 579 |
| 578 } // namespace compiler | 580 } // namespace compiler |
| 579 } // namespace internal | 581 } // namespace internal |
| 580 } // namespace v8 | 582 } // namespace v8 |
| OLD | NEW |