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

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

Issue 1098863003: Import Reversed adapter from Chromium and use it in v8. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed feedback. Rebased. Created 5 years, 8 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/instruction-selector-ppc.cc ('k') | src/compiler/scheduler.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/base/adapters.h"
5 #include "src/compiler/linkage.h" 6 #include "src/compiler/linkage.h"
6 #include "src/compiler/register-allocator.h" 7 #include "src/compiler/register-allocator.h"
7 #include "src/string-stream.h" 8 #include "src/string-stream.h"
8 9
9 namespace v8 { 10 namespace v8 {
10 namespace internal { 11 namespace internal {
11 namespace compiler { 12 namespace compiler {
12 13
13 #define TRACE(...) \ 14 #define TRACE(...) \
14 do { \ 15 do { \
(...skipping 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after
1404 1405
1405 void RegisterAllocator::MeetRegisterConstraints() { 1406 void RegisterAllocator::MeetRegisterConstraints() {
1406 for (auto block : code()->instruction_blocks()) { 1407 for (auto block : code()->instruction_blocks()) {
1407 MeetRegisterConstraints(block); 1408 MeetRegisterConstraints(block);
1408 } 1409 }
1409 } 1410 }
1410 1411
1411 1412
1412 void RegisterAllocator::ResolvePhis() { 1413 void RegisterAllocator::ResolvePhis() {
1413 // Process the blocks in reverse order. 1414 // Process the blocks in reverse order.
1414 for (auto i = code()->instruction_blocks().rbegin(); 1415 for (InstructionBlock* block : base::Reversed(code()->instruction_blocks())) {
1415 i != code()->instruction_blocks().rend(); ++i) { 1416 ResolvePhis(block);
1416 ResolvePhis(*i);
1417 } 1417 }
1418 } 1418 }
1419 1419
1420 1420
1421 const InstructionBlock* RegisterAllocator::GetInstructionBlock( 1421 const InstructionBlock* RegisterAllocator::GetInstructionBlock(
1422 LifetimePosition pos) { 1422 LifetimePosition pos) {
1423 return code()->GetInstructionBlock(pos.ToInstructionIndex()); 1423 return code()->GetInstructionBlock(pos.ToInstructionIndex());
1424 } 1424 }
1425 1425
1426 1426
(...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after
2512 range->set_assigned_register(reg); 2512 range->set_assigned_register(reg);
2513 auto assignment = range->GetAssignedOperand(); 2513 auto assignment = range->GetAssignedOperand();
2514 // TODO(dcarney): stop aliasing hint operands. 2514 // TODO(dcarney): stop aliasing hint operands.
2515 range->ConvertUsesToOperand(assignment, nullptr); 2515 range->ConvertUsesToOperand(assignment, nullptr);
2516 if (range->is_phi()) AssignPhiInput(range, assignment); 2516 if (range->is_phi()) AssignPhiInput(range, assignment);
2517 } 2517 }
2518 2518
2519 } // namespace compiler 2519 } // namespace compiler
2520 } // namespace internal 2520 } // namespace internal
2521 } // namespace v8 2521 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ppc/instruction-selector-ppc.cc ('k') | src/compiler/scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698