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

Unified Diff: src/compiler/move-optimizer.cc

Issue 948033002: [turbofan] only use two gaps (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/instruction.cc ('k') | src/compiler/register-allocator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/move-optimizer.cc
diff --git a/src/compiler/move-optimizer.cc b/src/compiler/move-optimizer.cc
index f4e05137756e0b903fd7527961b1be76515795fa..f7abcf462d6f6f17f6c78ac568d378de7e6de3f2 100644
--- a/src/compiler/move-optimizer.cc
+++ b/src/compiler/move-optimizer.cc
@@ -10,33 +10,6 @@ namespace compiler {
namespace {
-MoveOperands* PrepareInsertAfter(ParallelMove* left, MoveOperands* move,
- Zone* zone) {
- auto move_ops = left->move_operands();
- MoveOperands* replacement = nullptr;
- MoveOperands* to_eliminate = nullptr;
- for (auto curr = move_ops->begin(); curr != move_ops->end(); ++curr) {
- if (curr->IsEliminated()) continue;
- if (curr->destination()->Equals(move->source())) {
- DCHECK(!replacement);
- replacement = curr;
- if (to_eliminate != nullptr) break;
- } else if (curr->destination()->Equals(move->destination())) {
- DCHECK(!to_eliminate);
- to_eliminate = curr;
- if (replacement != nullptr) break;
- }
- }
- DCHECK(!(replacement == to_eliminate && replacement != nullptr));
- if (replacement != nullptr) {
- auto new_source = InstructionOperand::New(
- zone, replacement->source()->kind(), replacement->source()->index());
- move->set_source(new_source);
- }
- return to_eliminate;
-}
-
-
bool GapsCanMoveOver(Instruction* instr) {
DCHECK(!instr->IsGapMoves());
return instr->IsSourcePosition() || instr->IsNop();
@@ -90,7 +63,7 @@ void MoveOptimizer::CompressMoves(MoveOpVector* eliminated, ParallelMove* left,
// merging the two gaps.
for (auto op = move_ops->begin(); op != move_ops->end(); ++op) {
if (op->IsRedundant()) continue;
- MoveOperands* to_eliminate = PrepareInsertAfter(left, op, code_zone());
+ auto to_eliminate = left->PrepareInsertAfter(op);
if (to_eliminate != nullptr) eliminated->push_back(to_eliminate);
}
// Eliminate dead moves. Must happen before insertion of new moves as the
« no previous file with comments | « src/compiler/instruction.cc ('k') | src/compiler/register-allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698