| 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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 instructions_(zone()), | 451 instructions_(zone()), |
| 452 next_virtual_register_(0), | 452 next_virtual_register_(0), |
| 453 pointer_maps_(zone()), | 453 pointer_maps_(zone()), |
| 454 doubles_(std::less<int>(), VirtualRegisterSet::allocator_type(zone())), | 454 doubles_(std::less<int>(), VirtualRegisterSet::allocator_type(zone())), |
| 455 references_(std::less<int>(), VirtualRegisterSet::allocator_type(zone())), | 455 references_(std::less<int>(), VirtualRegisterSet::allocator_type(zone())), |
| 456 deoptimization_entries_(zone()) { | 456 deoptimization_entries_(zone()) { |
| 457 block_starts_.reserve(instruction_blocks_->size()); | 457 block_starts_.reserve(instruction_blocks_->size()); |
| 458 } | 458 } |
| 459 | 459 |
| 460 | 460 |
| 461 int InstructionSequence::NextVirtualRegister() { |
| 462 int virtual_register = next_virtual_register_++; |
| 463 CHECK_NE(virtual_register, UnallocatedOperand::kInvalidVirtualRegister); |
| 464 return virtual_register; |
| 465 } |
| 466 |
| 467 |
| 461 BlockStartInstruction* InstructionSequence::GetBlockStart( | 468 BlockStartInstruction* InstructionSequence::GetBlockStart( |
| 462 BasicBlock::RpoNumber rpo) const { | 469 BasicBlock::RpoNumber rpo) const { |
| 463 const InstructionBlock* block = InstructionBlockAt(rpo); | 470 const InstructionBlock* block = InstructionBlockAt(rpo); |
| 464 return BlockStartInstruction::cast(InstructionAt(block->code_start())); | 471 return BlockStartInstruction::cast(InstructionAt(block->code_start())); |
| 465 } | 472 } |
| 466 | 473 |
| 467 | 474 |
| 468 void InstructionSequence::StartBlock(BasicBlock::RpoNumber rpo) { | 475 void InstructionSequence::StartBlock(BasicBlock::RpoNumber rpo) { |
| 469 DCHECK(block_starts_.size() == rpo.ToSize()); | 476 DCHECK(block_starts_.size() == rpo.ToSize()); |
| 470 InstructionBlock* block = InstructionBlockAt(rpo); | 477 InstructionBlock* block = InstructionBlockAt(rpo); |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 os << " B" << succ_block->id(); | 701 os << " B" << succ_block->id(); |
| 695 } | 702 } |
| 696 os << "\n"; | 703 os << "\n"; |
| 697 } | 704 } |
| 698 return os; | 705 return os; |
| 699 } | 706 } |
| 700 | 707 |
| 701 } // namespace compiler | 708 } // namespace compiler |
| 702 } // namespace internal | 709 } // namespace internal |
| 703 } // namespace v8 | 710 } // namespace v8 |
| OLD | NEW |