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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
336 } else if (block->PredecessorCount() == 1 && block->phis().size() == 0) { | 336 } else if (block->PredecessorCount() == 1 && block->phis().size() == 0) { |
337 const BlockAssessments* prev_block = assessments_[block->predecessors()[0]]; | 337 const BlockAssessments* prev_block = assessments_[block->predecessors()[0]]; |
338 ret->CopyFrom(prev_block); | 338 ret->CopyFrom(prev_block); |
339 } else { | 339 } else { |
340 for (RpoNumber pred_id : block->predecessors()) { | 340 for (RpoNumber pred_id : block->predecessors()) { |
341 // For every operand coming from any of the predecessors, create an | 341 // For every operand coming from any of the predecessors, create an |
342 // Unfinalized assessment. | 342 // Unfinalized assessment. |
343 auto iterator = assessments_.find(pred_id); | 343 auto iterator = assessments_.find(pred_id); |
344 if (iterator == assessments_.end()) { | 344 if (iterator == assessments_.end()) { |
345 // This block is the head of a loop, and this predecessor is the | 345 // This block is the head of a loop, and this predecessor is the |
346 // loopback | 346 // loopback arc. |
Benedikt Meurer
2017/01/18 18:10:41
Can you revert this change? It's a bit confusing t
Camillo Bruni
2017/01/24 15:51:43
excluded.
| |
347 // arc. | |
348 // Validate this is a loop case, otherwise the CFG is malformed. | 347 // Validate this is a loop case, otherwise the CFG is malformed. |
349 CHECK(pred_id >= current_block_id); | 348 CHECK(pred_id >= current_block_id); |
350 CHECK(block->IsLoopHeader()); | 349 CHECK(block->IsLoopHeader()); |
351 continue; | 350 continue; |
352 } | 351 } |
353 const BlockAssessments* pred_assessments = iterator->second; | 352 const BlockAssessments* pred_assessments = iterator->second; |
354 CHECK_NOT_NULL(pred_assessments); | 353 CHECK_NOT_NULL(pred_assessments); |
355 for (auto pair : pred_assessments->map()) { | 354 for (auto pair : pred_assessments->map()) { |
356 InstructionOperand operand = pair.first; | 355 InstructionOperand operand = pair.first; |
357 if (ret->map().find(operand) == ret->map().end()) { | 356 if (ret->map().find(operand) == ret->map().end()) { |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
576 new (zone()) FinalAssessment(vreg, pending); | 575 new (zone()) FinalAssessment(vreg, pending); |
577 break; | 576 break; |
578 } | 577 } |
579 } | 578 } |
580 } | 579 } |
581 } | 580 } |
582 | 581 |
583 } // namespace compiler | 582 } // namespace compiler |
584 } // namespace internal | 583 } // namespace internal |
585 } // namespace v8 | 584 } // namespace v8 |
OLD | NEW |