| 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/move-optimizer.h" | 5 #include "src/compiler/move-optimizer.h" |
| 6 #include "test/unittests/compiler/instruction-sequence-unittest.h" | 6 #include "test/unittests/compiler/instruction-sequence-unittest.h" |
| 7 | 7 |
| 8 namespace v8 { | 8 namespace v8 { |
| 9 namespace internal { | 9 namespace internal { |
| 10 namespace compiler { | 10 namespace compiler { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 } | 60 } |
| 61 | 61 |
| 62 private: | 62 private: |
| 63 InstructionOperand ConvertMoveArg(TestOperand op) { | 63 InstructionOperand ConvertMoveArg(TestOperand op) { |
| 64 CHECK_EQ(kNoValue, op.vreg_.value_); | 64 CHECK_EQ(kNoValue, op.vreg_.value_); |
| 65 CHECK_NE(kNoValue, op.value_); | 65 CHECK_NE(kNoValue, op.value_); |
| 66 switch (op.type_) { | 66 switch (op.type_) { |
| 67 case kConstant: | 67 case kConstant: |
| 68 return ConstantOperand(op.value_); | 68 return ConstantOperand(op.value_); |
| 69 case kFixedSlot: | 69 case kFixedSlot: |
| 70 return AllocatedOperand(LocationOperand::STACK_SLOT, kRepWord32, | 70 return AllocatedOperand(LocationOperand::STACK_SLOT, |
| 71 op.value_); | 71 MachineRepresentation::kWord32, op.value_); |
| 72 case kFixedRegister: | 72 case kFixedRegister: |
| 73 CHECK(0 <= op.value_ && op.value_ < num_general_registers()); | 73 CHECK(0 <= op.value_ && op.value_ < num_general_registers()); |
| 74 return AllocatedOperand(LocationOperand::REGISTER, kRepWord32, | 74 return AllocatedOperand(LocationOperand::REGISTER, |
| 75 op.value_); | 75 MachineRepresentation::kWord32, op.value_); |
| 76 case kExplicit: | 76 case kExplicit: |
| 77 CHECK(0 <= op.value_ && op.value_ < num_general_registers()); | 77 CHECK(0 <= op.value_ && op.value_ < num_general_registers()); |
| 78 return ExplicitOperand(LocationOperand::REGISTER, kRepWord32, | 78 return ExplicitOperand(LocationOperand::REGISTER, |
| 79 op.value_); | 79 MachineRepresentation::kWord32, op.value_); |
| 80 default: | 80 default: |
| 81 break; | 81 break; |
| 82 } | 82 } |
| 83 CHECK(false); | 83 CHECK(false); |
| 84 return InstructionOperand(); | 84 return InstructionOperand(); |
| 85 } | 85 } |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 | 88 |
| 89 TEST_F(MoveOptimizerTest, RemovesRedundant) { | 89 TEST_F(MoveOptimizerTest, RemovesRedundant) { |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 } | 242 } |
| 243 } | 243 } |
| 244 CHECK_EQ(1, redundants); | 244 CHECK_EQ(1, redundants); |
| 245 CHECK_EQ(1, assignment); | 245 CHECK_EQ(1, assignment); |
| 246 } | 246 } |
| 247 | 247 |
| 248 | 248 |
| 249 } // namespace compiler | 249 } // namespace compiler |
| 250 } // namespace internal | 250 } // namespace internal |
| 251 } // namespace v8 | 251 } // namespace v8 |
| OLD | NEW |