Index: src/compiler/move-optimizer.cc |
diff --git a/src/compiler/move-optimizer.cc b/src/compiler/move-optimizer.cc |
index ea514aaa1351f1577af95cc6d6753990451b66c4..d55005f7680aeb2428e2bece4a10e57403448a52 100644 |
--- a/src/compiler/move-optimizer.cc |
+++ b/src/compiler/move-optimizer.cc |
@@ -11,8 +11,18 @@ namespace compiler { |
namespace { |
typedef std::pair<InstructionOperand, InstructionOperand> MoveKey; |
-typedef ZoneMap<MoveKey, unsigned> MoveMap; |
-typedef ZoneSet<InstructionOperand> OperandSet; |
+ |
+struct MoveKeyCompare { |
+ bool operator()(const MoveKey& a, const MoveKey& b) const { |
+ if (a.first.EqualsModuloType(b.first)) { |
+ return a.second.CompareModuloType(b.second); |
+ } |
+ return a.first.CompareModuloType(b.first); |
+ } |
+}; |
+ |
+typedef ZoneMap<MoveKey, unsigned, MoveKeyCompare> MoveMap; |
+typedef ZoneSet<InstructionOperand, CompareOperandModuloType> OperandSet; |
bool GapsCanMoveOver(Instruction* instr) { return instr->IsNop(); } |
@@ -224,10 +234,12 @@ bool IsSlot(const InstructionOperand& op) { |
bool LoadCompare(const MoveOperands* a, const MoveOperands* b) { |
- if (a->source() != b->source()) return a->source() < b->source(); |
+ if (!a->source().EqualsModuloType(b->source())) { |
+ return a->source().CompareModuloType(b->source()); |
+ } |
if (IsSlot(a->destination()) && !IsSlot(b->destination())) return false; |
if (!IsSlot(a->destination()) && IsSlot(b->destination())) return true; |
- return a->destination() < b->destination(); |
+ return a->destination().CompareModuloType(b->destination()); |
} |
} // namespace |
@@ -252,7 +264,8 @@ void MoveOptimizer::FinalizeMoves(Instruction* instr) { |
MoveOperands* group_begin = nullptr; |
for (auto load : loads) { |
// New group. |
- if (group_begin == nullptr || load->source() != group_begin->source()) { |
+ if (group_begin == nullptr || |
+ !load->source().EqualsModuloType(group_begin->source())) { |
group_begin = load; |
continue; |
} |