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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 << printable; | 62 << printable; |
63 } | 63 } |
64 } | 64 } |
65 | 65 |
66 private: | 66 private: |
67 InstructionOperand* ConvertMoveArg(TestOperand op) { | 67 InstructionOperand* ConvertMoveArg(TestOperand op) { |
68 CHECK_EQ(kNoValue, op.vreg_.value_); | 68 CHECK_EQ(kNoValue, op.vreg_.value_); |
69 CHECK_NE(kNoValue, op.value_); | 69 CHECK_NE(kNoValue, op.value_); |
70 switch (op.type_) { | 70 switch (op.type_) { |
71 case kConstant: | 71 case kConstant: |
72 return ConstantOperand::Create(op.value_, zone()); | 72 return ConstantOperand::New(op.value_, zone()); |
73 case kFixedSlot: | 73 case kFixedSlot: |
74 return StackSlotOperand::Create(op.value_, zone()); | 74 return StackSlotOperand::New(op.value_, zone()); |
75 case kFixedRegister: | 75 case kFixedRegister: |
76 CHECK(0 <= op.value_ && op.value_ < num_general_registers()); | 76 CHECK(0 <= op.value_ && op.value_ < num_general_registers()); |
77 return RegisterOperand::Create(op.value_, zone()); | 77 return RegisterOperand::New(op.value_, zone()); |
78 default: | 78 default: |
79 break; | 79 break; |
80 } | 80 } |
81 CHECK(false); | 81 CHECK(false); |
82 return nullptr; | 82 return nullptr; |
83 } | 83 } |
84 }; | 84 }; |
85 | 85 |
86 | 86 |
87 TEST_F(MoveOptimizerTest, RemovesRedundant) { | 87 TEST_F(MoveOptimizerTest, RemovesRedundant) { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 move = gap->parallel_moves()[1]; | 120 move = gap->parallel_moves()[1]; |
121 CHECK_EQ(3, NonRedundantSize(move)); | 121 CHECK_EQ(3, NonRedundantSize(move)); |
122 CHECK(Contains(move, Reg(0), Slot(0))); | 122 CHECK(Contains(move, Reg(0), Slot(0))); |
123 CHECK(Contains(move, Reg(0), Slot(1))); | 123 CHECK(Contains(move, Reg(0), Slot(1))); |
124 CHECK(Contains(move, Reg(0), Slot(2))); | 124 CHECK(Contains(move, Reg(0), Slot(2))); |
125 } | 125 } |
126 | 126 |
127 } // namespace compiler | 127 } // namespace compiler |
128 } // namespace internal | 128 } // namespace internal |
129 } // namespace v8 | 129 } // namespace v8 |
OLD | NEW |