| 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 #ifndef V8_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_ | 5 #ifndef V8_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_ |
| 6 #define V8_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_ | 6 #define V8_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 return IsReference(ToVreg(operand)); | 140 return IsReference(ToVreg(operand)); |
| 141 } | 141 } |
| 142 bool IsReference(int virtual_register) const { | 142 bool IsReference(int virtual_register) const { |
| 143 return references_.find(virtual_register) != references_.end(); | 143 return references_.find(virtual_register) != references_.end(); |
| 144 } | 144 } |
| 145 | 145 |
| 146 int32_t ToInt32(const InstructionOperand* operand) const { | 146 int32_t ToInt32(const InstructionOperand* operand) const { |
| 147 return ToConstant(operand).ToInt32(); | 147 return ToConstant(operand).ToInt32(); |
| 148 } | 148 } |
| 149 | 149 |
| 150 int64_t ToInt64(const InstructionOperand* operand) const { |
| 151 return ToConstant(operand).ToInt64(); |
| 152 } |
| 153 |
| 150 int ToVreg(const InstructionOperand* operand) const { | 154 int ToVreg(const InstructionOperand* operand) const { |
| 151 if (operand->IsConstant()) return operand->index(); | 155 if (operand->IsConstant()) return operand->index(); |
| 152 EXPECT_EQ(InstructionOperand::UNALLOCATED, operand->kind()); | 156 EXPECT_EQ(InstructionOperand::UNALLOCATED, operand->kind()); |
| 153 return UnallocatedOperand::cast(operand)->virtual_register(); | 157 return UnallocatedOperand::cast(operand)->virtual_register(); |
| 154 } | 158 } |
| 155 | 159 |
| 156 FrameStateDescriptor* GetFrameStateDescriptor(int deoptimization_id) { | 160 FrameStateDescriptor* GetFrameStateDescriptor(int deoptimization_id) { |
| 157 EXPECT_LT(deoptimization_id, GetFrameStateDescriptorCount()); | 161 EXPECT_LT(deoptimization_id, GetFrameStateDescriptorCount()); |
| 158 return deoptimization_entries_[deoptimization_id]; | 162 return deoptimization_entries_[deoptimization_id]; |
| 159 } | 163 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 template <typename T> | 200 template <typename T> |
| 197 class InstructionSelectorTestWithParam | 201 class InstructionSelectorTestWithParam |
| 198 : public InstructionSelectorTest, | 202 : public InstructionSelectorTest, |
| 199 public ::testing::WithParamInterface<T> {}; | 203 public ::testing::WithParamInterface<T> {}; |
| 200 | 204 |
| 201 } // namespace compiler | 205 } // namespace compiler |
| 202 } // namespace internal | 206 } // namespace internal |
| 203 } // namespace v8 | 207 } // namespace v8 |
| 204 | 208 |
| 205 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_ | 209 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_ |
| OLD | NEW |