| OLD | NEW | 
|---|
| 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/compiler/gap-resolver.h" | 5 #include "src/compiler/gap-resolver.h" | 
| 6 | 6 | 
| 7 #include <algorithm> | 7 #include <algorithm> | 
| 8 #include <functional> | 8 #include <functional> | 
| 9 #include <set> | 9 #include <set> | 
| 10 | 10 | 
| 11 namespace v8 { | 11 namespace v8 { | 
| 12 namespace internal { | 12 namespace internal { | 
| 13 namespace compiler { | 13 namespace compiler { | 
| 14 | 14 | 
| 15 typedef ZoneList<MoveOperands>::iterator op_iterator; | 15 typedef ZoneList<MoveOperands>::iterator op_iterator; | 
| 16 | 16 | 
| 17 #ifdef ENABLE_SLOW_ASSERTS | 17 #ifdef ENABLE_SLOW_ASSERTS | 
| 18 // TODO(svenpanne) Brush up InstructionOperand with comparison? | 18 // TODO(svenpanne) Brush up InstructionOperand with comparison? | 
| 19 struct InstructionOperandComparator { | 19 struct InstructionOperandComparator { | 
| 20   bool operator()(const InstructionOperand* x, const InstructionOperand* y) { | 20   bool operator()(const InstructionOperand* x, | 
|  | 21                   const InstructionOperand* y) const { | 
| 21     return (x->kind() < y->kind()) || | 22     return (x->kind() < y->kind()) || | 
| 22            (x->kind() == y->kind() && x->index() < y->index()); | 23            (x->kind() == y->kind() && x->index() < y->index()); | 
| 23   } | 24   } | 
| 24 }; | 25 }; | 
| 25 #endif | 26 #endif | 
| 26 | 27 | 
| 27 // No operand should be the destination for more than one move. | 28 // No operand should be the destination for more than one move. | 
| 28 static void VerifyMovesAreInjective(ZoneList<MoveOperands>* moves) { | 29 static void VerifyMovesAreInjective(ZoneList<MoveOperands>* moves) { | 
| 29 #ifdef ENABLE_SLOW_ASSERTS | 30 #ifdef ENABLE_SLOW_ASSERTS | 
| 30   std::set<InstructionOperand*, InstructionOperandComparator> seen; | 31   std::set<InstructionOperand*, InstructionOperandComparator> seen; | 
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 126     if (other->Blocks(source)) { | 127     if (other->Blocks(source)) { | 
| 127       other->set_source(destination); | 128       other->set_source(destination); | 
| 128     } else if (other->Blocks(destination)) { | 129     } else if (other->Blocks(destination)) { | 
| 129       other->set_source(source); | 130       other->set_source(source); | 
| 130     } | 131     } | 
| 131   } | 132   } | 
| 132 } | 133 } | 
| 133 } | 134 } | 
| 134 } | 135 } | 
| 135 }  // namespace v8::internal::compiler | 136 }  // namespace v8::internal::compiler | 
| OLD | NEW | 
|---|