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

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

Issue 1422333003: [turbofan] optimize redundant moves around splinter sites (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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
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/base/adapters.h"
6 #include "src/compiler/linkage.h" 6 #include "src/compiler/linkage.h"
7 #include "src/compiler/register-allocator.h" 7 #include "src/compiler/register-allocator.h"
8 #include "src/string-stream.h" 8 #include "src/string-stream.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 1417 matching lines...) Expand 10 before | Expand all | Expand 10 after
1428 } 1428 }
1429 1429
1430 1430
1431 bool RegisterAllocationData::IsBlockBoundary(LifetimePosition pos) const { 1431 bool RegisterAllocationData::IsBlockBoundary(LifetimePosition pos) const {
1432 return pos.IsFullStart() && 1432 return pos.IsFullStart() &&
1433 code()->GetInstructionBlock(pos.ToInstructionIndex())->code_start() == 1433 code()->GetInstructionBlock(pos.ToInstructionIndex())->code_start() ==
1434 pos.ToInstructionIndex(); 1434 pos.ToInstructionIndex();
1435 } 1435 }
1436 1436
1437 1437
1438 void RegisterAllocationData::Print( 1438 void Print(const RegisterConfiguration* config,
1439 const InstructionSequence* instructionSequence) { 1439 const InstructionSequence* instructionSequence) {
1440 OFStream os(stdout); 1440 OFStream os(stdout);
1441 PrintableInstructionSequence wrapper; 1441 PrintableInstructionSequence wrapper;
1442 wrapper.register_configuration_ = config(); 1442 wrapper.register_configuration_ = config;
1443 wrapper.sequence_ = instructionSequence; 1443 wrapper.sequence_ = instructionSequence;
1444 os << wrapper << std::endl; 1444 os << wrapper << std::endl;
1445 } 1445 }
1446 1446
1447 1447
1448 void RegisterAllocationData::Print(const Instruction* instruction) { 1448 void Print(const RegisterConfiguration* config,
1449 const Instruction* instruction) {
1449 OFStream os(stdout); 1450 OFStream os(stdout);
1450 PrintableInstruction wrapper; 1451 PrintableInstruction wrapper;
1451 wrapper.instr_ = instruction; 1452 wrapper.instr_ = instruction;
1452 wrapper.register_configuration_ = config(); 1453 wrapper.register_configuration_ = config;
1453 os << wrapper << std::endl; 1454 os << wrapper << std::endl;
1454 } 1455 }
1455 1456
1456 1457
1457 void RegisterAllocationData::Print(const LiveRange* range, bool with_children) { 1458 void Print(const RegisterConfiguration* config, const LiveRange* range,
1459 bool with_children) {
1458 OFStream os(stdout); 1460 OFStream os(stdout);
1459 PrintableLiveRange wrapper; 1461 PrintableLiveRange wrapper;
1460 wrapper.register_configuration_ = config(); 1462 wrapper.register_configuration_ = config;
1461 for (const LiveRange* i = range; i != nullptr; i = i->next()) { 1463 for (const LiveRange* i = range; i != nullptr; i = i->next()) {
1462 wrapper.range_ = i; 1464 wrapper.range_ = i;
1463 os << wrapper << std::endl; 1465 os << wrapper << std::endl;
1464 if (!with_children) break; 1466 if (!with_children) break;
1465 } 1467 }
1466 } 1468 }
1467 1469
1468 1470
1469 void RegisterAllocationData::Print(const InstructionOperand& op) { 1471 void Print(const RegisterConfiguration* config, const InstructionOperand& op) {
1470 OFStream os(stdout); 1472 OFStream os(stdout);
1471 PrintableInstructionOperand wrapper; 1473 PrintableInstructionOperand wrapper;
1472 wrapper.register_configuration_ = config(); 1474 wrapper.register_configuration_ = config;
1473 wrapper.op_ = op; 1475 wrapper.op_ = op;
1474 os << wrapper << std::endl; 1476 os << wrapper << std::endl;
1475 } 1477 }
1476 1478
1477 1479
1478 void RegisterAllocationData::Print(const MoveOperands* move) { 1480 void Print(const RegisterConfiguration* config, const MoveOperands* move) {
1479 OFStream os(stdout); 1481 OFStream os(stdout);
1480 PrintableInstructionOperand wrapper; 1482 PrintableInstructionOperand wrapper;
1481 wrapper.register_configuration_ = config(); 1483 wrapper.register_configuration_ = config;
1482 wrapper.op_ = move->destination(); 1484 wrapper.op_ = move->destination();
1483 os << wrapper << " = "; 1485 os << wrapper << " = ";
1484 wrapper.op_ = move->source(); 1486 wrapper.op_ = move->source();
1485 os << wrapper << std::endl; 1487 os << wrapper << std::endl;
1486 } 1488 }
1487 1489
1488 1490
1489 void RegisterAllocationData::Print(const SpillRange* spill_range) { 1491 void Print(const RegisterConfiguration* config, const SpillRange* spill_range) {
1490 OFStream os(stdout); 1492 OFStream os(stdout);
1491 os << "{" << std::endl; 1493 os << "{" << std::endl;
1492 for (TopLevelLiveRange* range : spill_range->live_ranges()) { 1494 for (TopLevelLiveRange* range : spill_range->live_ranges()) {
1493 os << range->vreg() << " "; 1495 os << range->vreg() << " ";
1494 } 1496 }
1495 os << std::endl; 1497 os << std::endl;
1496 1498
1497 for (UseInterval* interval = spill_range->interval(); interval != nullptr; 1499 for (UseInterval* interval = spill_range->interval(); interval != nullptr;
1498 interval = interval->next()) { 1500 interval = interval->next()) {
1499 os << '[' << interval->start() << ", " << interval->end() << ')' 1501 os << '[' << interval->start() << ", " << interval->end() << ')'
(...skipping 1943 matching lines...) Expand 10 before | Expand all | Expand 10 after
3443 auto eliminate = moves->PrepareInsertAfter(move); 3445 auto eliminate = moves->PrepareInsertAfter(move);
3444 to_insert.push_back(move); 3446 to_insert.push_back(move);
3445 if (eliminate != nullptr) to_eliminate.push_back(eliminate); 3447 if (eliminate != nullptr) to_eliminate.push_back(eliminate);
3446 } 3448 }
3447 } 3449 }
3448 3450
3449 3451
3450 } // namespace compiler 3452 } // namespace compiler
3451 } // namespace internal 3453 } // namespace internal
3452 } // namespace v8 3454 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698