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_UNITTESTS_INSTRUCTION_SELECTOR_UNITTEST_H_ | 5 #ifndef V8_COMPILER_UNITTESTS_INSTRUCTION_SELECTOR_UNITTEST_H_ |
6 #define V8_COMPILER_UNITTESTS_INSTRUCTION_SELECTOR_UNITTEST_H_ | 6 #define V8_COMPILER_UNITTESTS_INSTRUCTION_SELECTOR_UNITTEST_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 int32_t ToInt32(const InstructionOperand* operand) const { | 143 int32_t ToInt32(const InstructionOperand* operand) const { |
144 return ToConstant(operand).ToInt32(); | 144 return ToConstant(operand).ToInt32(); |
145 } | 145 } |
146 | 146 |
147 int ToVreg(const InstructionOperand* operand) const { | 147 int ToVreg(const InstructionOperand* operand) const { |
148 if (operand->IsConstant()) return operand->index(); | 148 if (operand->IsConstant()) return operand->index(); |
149 EXPECT_EQ(InstructionOperand::UNALLOCATED, operand->kind()); | 149 EXPECT_EQ(InstructionOperand::UNALLOCATED, operand->kind()); |
150 return UnallocatedOperand::cast(operand)->virtual_register(); | 150 return UnallocatedOperand::cast(operand)->virtual_register(); |
151 } | 151 } |
152 | 152 |
153 FrameStateDescriptor* GetDeoptimizationEntry(int deoptimization_id) { | 153 FrameStateDescriptor* GetFrameStateDescriptor(int deoptimization_id) { |
154 EXPECT_LT(deoptimization_id, GetDeoptimizationEntryCount()); | 154 EXPECT_LT(deoptimization_id, GetFrameStateDescriptorCount()); |
155 return deoptimization_entries_[deoptimization_id]; | 155 return deoptimization_entries_[deoptimization_id]; |
156 } | 156 } |
157 | 157 |
158 int GetDeoptimizationEntryCount() { | 158 int GetFrameStateDescriptorCount() { |
159 return static_cast<int>(deoptimization_entries_.size()); | 159 return static_cast<int>(deoptimization_entries_.size()); |
160 } | 160 } |
161 | 161 |
162 private: | 162 private: |
163 Constant ToConstant(const InstructionOperand* operand) const { | 163 Constant ToConstant(const InstructionOperand* operand) const { |
164 ConstantMap::const_iterator i; | 164 ConstantMap::const_iterator i; |
165 if (operand->IsConstant()) { | 165 if (operand->IsConstant()) { |
166 i = constants_.find(operand->index()); | 166 i = constants_.find(operand->index()); |
167 EXPECT_FALSE(constants_.end() == i); | 167 EXPECT_FALSE(constants_.end() == i); |
168 } else { | 168 } else { |
(...skipping 24 matching lines...) Expand all Loading... |
193 template <typename T> | 193 template <typename T> |
194 class InstructionSelectorTestWithParam | 194 class InstructionSelectorTestWithParam |
195 : public InstructionSelectorTest, | 195 : public InstructionSelectorTest, |
196 public ::testing::WithParamInterface<T> {}; | 196 public ::testing::WithParamInterface<T> {}; |
197 | 197 |
198 } // namespace compiler | 198 } // namespace compiler |
199 } // namespace internal | 199 } // namespace internal |
200 } // namespace v8 | 200 } // namespace v8 |
201 | 201 |
202 #endif // V8_COMPILER_UNITTESTS_INSTRUCTION_SELECTOR_UNITTEST_H_ | 202 #endif // V8_COMPILER_UNITTESTS_INSTRUCTION_SELECTOR_UNITTEST_H_ |
OLD | NEW |