Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: src/compiler/register-allocator.cc

Issue 951553005: [turbofan] remove dependence of InstructionBlock on BasicBlock (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/ppc/code-generator-ppc.cc ('k') | src/compiler/register-allocator-verifier.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/linkage.h" 5 #include "src/compiler/linkage.h"
6 #include "src/compiler/register-allocator.h" 6 #include "src/compiler/register-allocator.h"
7 #include "src/string-stream.h" 7 #include "src/string-stream.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after
1699 position = GapInstruction::END; 1699 position = GapInstruction::END;
1700 } 1700 }
1701 AddGapMove(gap_index, position, pred_op, cur_op); 1701 AddGapMove(gap_index, position, pred_op, cur_op);
1702 } 1702 }
1703 1703
1704 1704
1705 void RegisterAllocator::BuildLiveRanges() { 1705 void RegisterAllocator::BuildLiveRanges() {
1706 // Process the blocks in reverse order. 1706 // Process the blocks in reverse order.
1707 for (int block_id = code()->InstructionBlockCount() - 1; block_id >= 0; 1707 for (int block_id = code()->InstructionBlockCount() - 1; block_id >= 0;
1708 --block_id) { 1708 --block_id) {
1709 auto block = 1709 auto block = code()->InstructionBlockAt(RpoNumber::FromInt(block_id));
1710 code()->InstructionBlockAt(BasicBlock::RpoNumber::FromInt(block_id));
1711 auto live = ComputeLiveOut(block); 1710 auto live = ComputeLiveOut(block);
1712 // Initially consider all live_out values live for the entire block. We 1711 // Initially consider all live_out values live for the entire block. We
1713 // will shorten these intervals if necessary. 1712 // will shorten these intervals if necessary.
1714 AddInitialIntervals(block, live); 1713 AddInitialIntervals(block, live);
1715 1714
1716 // Process the instructions in reverse order, generating and killing 1715 // Process the instructions in reverse order, generating and killing
1717 // live values. 1716 // live values.
1718 ProcessInstructions(block, live); 1717 ProcessInstructions(block, live);
1719 // All phi output operands are killed by this block. 1718 // All phi output operands are killed by this block.
1720 for (auto phi : block->phis()) { 1719 for (auto phi : block->phis()) {
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after
2529 } else { 2528 } else {
2530 DCHECK(range->Kind() == GENERAL_REGISTERS); 2529 DCHECK(range->Kind() == GENERAL_REGISTERS);
2531 assigned_registers_->Add(reg); 2530 assigned_registers_->Add(reg);
2532 } 2531 }
2533 range->set_assigned_register(reg, operand_cache()); 2532 range->set_assigned_register(reg, operand_cache());
2534 } 2533 }
2535 2534
2536 } // namespace compiler 2535 } // namespace compiler
2537 } // namespace internal 2536 } // namespace internal
2538 } // namespace v8 2537 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ppc/code-generator-ppc.cc ('k') | src/compiler/register-allocator-verifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698