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 14 matching lines...) Expand all Loading... |
25 base::RandomNumberGenerator* rng() { return &rng_; } | 25 base::RandomNumberGenerator* rng() { return &rng_; } |
26 | 26 |
27 class Stream; | 27 class Stream; |
28 | 28 |
29 enum StreamBuilderMode { | 29 enum StreamBuilderMode { |
30 kAllInstructions, | 30 kAllInstructions, |
31 kTargetInstructions, | 31 kTargetInstructions, |
32 kAllExceptNopInstructions | 32 kAllExceptNopInstructions |
33 }; | 33 }; |
34 | 34 |
35 class StreamBuilder V8_FINAL : public RawMachineAssembler { | 35 class StreamBuilder FINAL : public RawMachineAssembler { |
36 public: | 36 public: |
37 StreamBuilder(InstructionSelectorTest* test, MachineType return_type) | 37 StreamBuilder(InstructionSelectorTest* test, MachineType return_type) |
38 : RawMachineAssembler(new (test->zone()) Graph(test->zone()), | 38 : RawMachineAssembler(new (test->zone()) Graph(test->zone()), |
39 CallDescriptorBuilder(test->zone(), return_type)), | 39 CallDescriptorBuilder(test->zone(), return_type)), |
40 test_(test) {} | 40 test_(test) {} |
41 StreamBuilder(InstructionSelectorTest* test, MachineType return_type, | 41 StreamBuilder(InstructionSelectorTest* test, MachineType return_type, |
42 MachineType parameter0_type) | 42 MachineType parameter0_type) |
43 : RawMachineAssembler(new (test->zone()) Graph(test->zone()), | 43 : RawMachineAssembler(new (test->zone()) Graph(test->zone()), |
44 CallDescriptorBuilder(test->zone(), return_type, | 44 CallDescriptorBuilder(test->zone(), return_type, |
45 parameter0_type)), | 45 parameter0_type)), |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 parameter_types[1] = parameter1_type; | 104 parameter_types[1] = parameter1_type; |
105 parameter_types[2] = parameter2_type; | 105 parameter_types[2] = parameter2_type; |
106 return new (zone) | 106 return new (zone) |
107 MachineCallDescriptorBuilder(return_type, 3, parameter_types); | 107 MachineCallDescriptorBuilder(return_type, 3, parameter_types); |
108 } | 108 } |
109 | 109 |
110 private: | 110 private: |
111 InstructionSelectorTest* test_; | 111 InstructionSelectorTest* test_; |
112 }; | 112 }; |
113 | 113 |
114 class Stream V8_FINAL { | 114 class Stream FINAL { |
115 public: | 115 public: |
116 size_t size() const { return instructions_.size(); } | 116 size_t size() const { return instructions_.size(); } |
117 const Instruction* operator[](size_t index) const { | 117 const Instruction* operator[](size_t index) const { |
118 EXPECT_LT(index, size()); | 118 EXPECT_LT(index, size()); |
119 return instructions_[index]; | 119 return instructions_[index]; |
120 } | 120 } |
121 | 121 |
122 bool IsDouble(const InstructionOperand* operand) const { | 122 bool IsDouble(const InstructionOperand* operand) const { |
123 return IsDouble(ToVreg(operand)); | 123 return IsDouble(ToVreg(operand)); |
124 } | 124 } |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after 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_INSTRUCTION_SELECTOR_UNITTEST_H_ | 202 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_ |
OLD | NEW |