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_UNITTESTS_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_ | 5 #ifndef V8_UNITTESTS_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_ |
6 #define V8_UNITTESTS_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_ | 6 #define V8_UNITTESTS_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 enum StreamBuilderMode { | 31 enum StreamBuilderMode { |
32 kAllInstructions, | 32 kAllInstructions, |
33 kTargetInstructions, | 33 kTargetInstructions, |
34 kAllExceptNopInstructions | 34 kAllExceptNopInstructions |
35 }; | 35 }; |
36 | 36 |
37 class StreamBuilder final : public RawMachineAssembler { | 37 class StreamBuilder final : public RawMachineAssembler { |
38 public: | 38 public: |
39 StreamBuilder(InstructionSelectorTest* test, MachineType return_type) | 39 StreamBuilder(InstructionSelectorTest* test, MachineType return_type) |
40 : RawMachineAssembler(test->isolate(), | 40 : RawMachineAssembler( |
41 new (test->zone()) Graph(test->zone()), | 41 test->isolate(), new (test->zone()) Graph(test->zone()), |
42 MakeMachineSignature(test->zone(), return_type)), | 42 MakeMachineSignature(test->zone(), return_type), kMachPtr, |
| 43 MachineOperatorBuilder::kAllOptionalOps), |
43 test_(test) {} | 44 test_(test) {} |
44 StreamBuilder(InstructionSelectorTest* test, MachineType return_type, | 45 StreamBuilder(InstructionSelectorTest* test, MachineType return_type, |
45 MachineType parameter0_type) | 46 MachineType parameter0_type) |
46 : RawMachineAssembler( | 47 : RawMachineAssembler( |
47 test->isolate(), new (test->zone()) Graph(test->zone()), | 48 test->isolate(), new (test->zone()) Graph(test->zone()), |
48 MakeMachineSignature(test->zone(), return_type, parameter0_type)), | 49 MakeMachineSignature(test->zone(), return_type, parameter0_type), |
| 50 kMachPtr, MachineOperatorBuilder::kAllOptionalOps), |
49 test_(test) {} | 51 test_(test) {} |
50 StreamBuilder(InstructionSelectorTest* test, MachineType return_type, | 52 StreamBuilder(InstructionSelectorTest* test, MachineType return_type, |
51 MachineType parameter0_type, MachineType parameter1_type) | 53 MachineType parameter0_type, MachineType parameter1_type) |
52 : RawMachineAssembler( | 54 : RawMachineAssembler( |
53 test->isolate(), new (test->zone()) Graph(test->zone()), | 55 test->isolate(), new (test->zone()) Graph(test->zone()), |
54 MakeMachineSignature(test->zone(), return_type, parameter0_type, | 56 MakeMachineSignature(test->zone(), return_type, parameter0_type, |
55 parameter1_type)), | 57 parameter1_type), |
| 58 kMachPtr, MachineOperatorBuilder::kAllOptionalOps), |
56 test_(test) {} | 59 test_(test) {} |
57 StreamBuilder(InstructionSelectorTest* test, MachineType return_type, | 60 StreamBuilder(InstructionSelectorTest* test, MachineType return_type, |
58 MachineType parameter0_type, MachineType parameter1_type, | 61 MachineType parameter0_type, MachineType parameter1_type, |
59 MachineType parameter2_type) | 62 MachineType parameter2_type) |
60 : RawMachineAssembler( | 63 : RawMachineAssembler( |
61 test->isolate(), new (test->zone()) Graph(test->zone()), | 64 test->isolate(), new (test->zone()) Graph(test->zone()), |
62 MakeMachineSignature(test->zone(), return_type, parameter0_type, | 65 MakeMachineSignature(test->zone(), return_type, parameter0_type, |
63 parameter1_type, parameter2_type)), | 66 parameter1_type, parameter2_type), |
| 67 kMachPtr, MachineOperatorBuilder::kAllOptionalOps), |
64 test_(test) {} | 68 test_(test) {} |
65 | 69 |
66 Stream Build(CpuFeature feature) { | 70 Stream Build(CpuFeature feature) { |
67 return Build(InstructionSelector::Features(feature)); | 71 return Build(InstructionSelector::Features(feature)); |
68 } | 72 } |
69 Stream Build(CpuFeature feature1, CpuFeature feature2) { | 73 Stream Build(CpuFeature feature1, CpuFeature feature2) { |
70 return Build(InstructionSelector::Features(feature1, feature2)); | 74 return Build(InstructionSelector::Features(feature1, feature2)); |
71 } | 75 } |
72 Stream Build(StreamBuilderMode mode = kTargetInstructions) { | 76 Stream Build(StreamBuilderMode mode = kTargetInstructions) { |
73 return Build(InstructionSelector::Features(), mode); | 77 return Build(InstructionSelector::Features(), mode); |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 template <typename T> | 247 template <typename T> |
244 class InstructionSelectorTestWithParam | 248 class InstructionSelectorTestWithParam |
245 : public InstructionSelectorTest, | 249 : public InstructionSelectorTest, |
246 public ::testing::WithParamInterface<T> {}; | 250 public ::testing::WithParamInterface<T> {}; |
247 | 251 |
248 } // namespace compiler | 252 } // namespace compiler |
249 } // namespace internal | 253 } // namespace internal |
250 } // namespace v8 | 254 } // namespace v8 |
251 | 255 |
252 #endif // V8_UNITTESTS_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_ | 256 #endif // V8_UNITTESTS_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_ |
OLD | NEW |