Chromium Code Reviews| Index: src/compiler/move-optimizer.cc |
| diff --git a/src/compiler/move-optimizer.cc b/src/compiler/move-optimizer.cc |
| index c4776f7f07b78c0894a95473f8e2d3fe5d22ca7e..64b24425210b1c05c8deffd3b3991f012708a839 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_; |
|
Jarin
2016/01/27 05:11:50
You should not have underscores at the end for pub
Mircea Trofin
2016/01/27 06:37:43
Oh! Happy to remove them!
Some parts of the code
|
| + 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; |
| } |