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

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

Issue 1641523002: [turbofan] improved move optimizer readability: MoveKey (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | no next file » | 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 c4776f7f07b78c0894a95473f8e2d3fe5d22ca7e..132ac02f423a2d03d069af28c6e3f3f79e9eefa3 100644
--- a/src/compiler/move-optimizer.cc
+++ b/src/compiler/move-optimizer.cc
@@ -10,14 +10,17 @@ namespace compiler {
namespace {
-typedef std::pair<InstructionOperand, InstructionOperand> MoveKey;
+struct MoveKey {
+ InstructionOperand source;
+ InstructionOperand destination;
+};
struct MoveKeyCompare {
bool operator()(const MoveKey& a, const MoveKey& b) const {
- if (a.first.EqualsCanonicalized(b.first)) {
- return a.second.CompareCanonicalized(b.second);
+ if (a.source.EqualsCanonicalized(b.source)) {
+ return a.destination.CompareCanonicalized(b.destination);
}
- return a.first.CompareCanonicalized(b.first);
+ return a.source.CompareCanonicalized(b.source);
}
};
@@ -273,7 +276,7 @@ void MoveOptimizer::OptimizeMerge(InstructionBlock* block) {
auto current = iter;
++iter;
if (current->second != block->PredecessorCount()) {
- InstructionOperand dest = current->first.second;
+ InstructionOperand dest = current->first.destination;
// Not all the moves in all the gaps are the same. Maybe some are. If
// there are such moves, we could move them, but the destination of the
// moves staying behind can't appear as a source of a common move,
@@ -292,9 +295,9 @@ void MoveOptimizer::OptimizeMerge(InstructionBlock* block) {
auto current = iter;
++iter;
DCHECK_EQ(block->PredecessorCount(), current->second);
- if (conflicting_srcs.find(current->first.first) !=
+ if (conflicting_srcs.find(current->first.source) !=
conflicting_srcs.end()) {
- conflicting_srcs.insert(current->first.second);
+ conflicting_srcs.insert(current->first.destination);
move_map.erase(current);
changed = true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698