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/common-operator.h" | 5 #include "src/compiler/common-operator.h" |
6 #include "src/compiler/graph.h" | 6 #include "src/compiler/graph.h" |
7 #include "src/compiler/instruction.h" | 7 #include "src/compiler/instruction.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 | 440 |
441 | 441 |
442 InstructionBlocks* InstructionSequence::InstructionBlocksFor( | 442 InstructionBlocks* InstructionSequence::InstructionBlocksFor( |
443 Zone* zone, const Schedule* schedule) { | 443 Zone* zone, const Schedule* schedule) { |
444 InstructionBlocks* blocks = zone->NewArray<InstructionBlocks>(1); | 444 InstructionBlocks* blocks = zone->NewArray<InstructionBlocks>(1); |
445 new (blocks) InstructionBlocks( | 445 new (blocks) InstructionBlocks( |
446 static_cast<int>(schedule->rpo_order()->size()), NULL, zone); | 446 static_cast<int>(schedule->rpo_order()->size()), NULL, zone); |
447 size_t rpo_number = 0; | 447 size_t rpo_number = 0; |
448 for (BasicBlockVector::const_iterator it = schedule->rpo_order()->begin(); | 448 for (BasicBlockVector::const_iterator it = schedule->rpo_order()->begin(); |
449 it != schedule->rpo_order()->end(); ++it, ++rpo_number) { | 449 it != schedule->rpo_order()->end(); ++it, ++rpo_number) { |
450 DCHECK_EQ(NULL, (*blocks)[rpo_number]); | 450 DCHECK(!(*blocks)[rpo_number]); |
451 DCHECK((*it)->GetRpoNumber().ToSize() == rpo_number); | 451 DCHECK((*it)->GetRpoNumber().ToSize() == rpo_number); |
452 (*blocks)[rpo_number] = InstructionBlockFor(zone, *it); | 452 (*blocks)[rpo_number] = InstructionBlockFor(zone, *it); |
453 } | 453 } |
454 ComputeAssemblyOrder(blocks); | 454 ComputeAssemblyOrder(blocks); |
455 return blocks; | 455 return blocks; |
456 } | 456 } |
457 | 457 |
458 | 458 |
459 void InstructionSequence::ComputeAssemblyOrder(InstructionBlocks* blocks) { | 459 void InstructionSequence::ComputeAssemblyOrder(InstructionBlocks* blocks) { |
460 int ao = 0; | 460 int ao = 0; |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 os << " B" << succ_block->id(); | 734 os << " B" << succ_block->id(); |
735 } | 735 } |
736 os << "\n"; | 736 os << "\n"; |
737 } | 737 } |
738 return os; | 738 return os; |
739 } | 739 } |
740 | 740 |
741 } // namespace compiler | 741 } // namespace compiler |
742 } // namespace internal | 742 } // namespace internal |
743 } // namespace v8 | 743 } // namespace v8 |
OLD | NEW |