| 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 "src/base/utils/random-number-generator.h" | 7 #include "src/base/utils/random-number-generator.h" |
| 8 #include "test/cctest/cctest.h" | 8 #include "test/cctest/cctest.h" |
| 9 | 9 |
| 10 using namespace v8::internal; | 10 using namespace v8::internal; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 } | 51 } |
| 52 | 52 |
| 53 static Key KeyFor(const InstructionOperand* op) { | 53 static Key KeyFor(const InstructionOperand* op) { |
| 54 return Key(op->kind(), op->index()); | 54 return Key(op->kind(), op->index()); |
| 55 } | 55 } |
| 56 | 56 |
| 57 static Value ValueFor(const InstructionOperand* op) { | 57 static Value ValueFor(const InstructionOperand* op) { |
| 58 return Value(op->kind(), op->index()); | 58 return Value(op->kind(), op->index()); |
| 59 } | 59 } |
| 60 | 60 |
| 61 friend OStream& operator<<(OStream& os, const InterpreterState& is) { | 61 friend std::ostream& operator<<(std::ostream& os, |
| 62 const InterpreterState& is) { |
| 62 for (OperandMap::const_iterator it = is.values_.begin(); | 63 for (OperandMap::const_iterator it = is.values_.begin(); |
| 63 it != is.values_.end(); ++it) { | 64 it != is.values_.end(); ++it) { |
| 64 if (it != is.values_.begin()) os << " "; | 65 if (it != is.values_.begin()) os << " "; |
| 65 InstructionOperand source(it->first.first, it->first.second); | 66 InstructionOperand source(it->first.first, it->first.second); |
| 66 InstructionOperand destination(it->second.first, it->second.second); | 67 InstructionOperand destination(it->second.first, it->second.second); |
| 67 os << MoveOperands(&source, &destination); | 68 os << MoveOperands(&source, &destination); |
| 68 } | 69 } |
| 69 return os; | 70 return os; |
| 70 } | 71 } |
| 71 | 72 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 mi1.AssembleParallelMove(pm); | 165 mi1.AssembleParallelMove(pm); |
| 165 | 166 |
| 166 MoveInterpreter mi2; | 167 MoveInterpreter mi2; |
| 167 GapResolver resolver(&mi2); | 168 GapResolver resolver(&mi2); |
| 168 resolver.Resolve(pm); | 169 resolver.Resolve(pm); |
| 169 | 170 |
| 170 CHECK(mi1.state() == mi2.state()); | 171 CHECK(mi1.state() == mi2.state()); |
| 171 } | 172 } |
| 172 } | 173 } |
| 173 } | 174 } |
| OLD | NEW |