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( | 40 : RawMachineAssembler(test->isolate(), |
41 test->isolate(), new (test->zone()) Graph(test->zone()), | 41 new (test->zone()) Graph(test->zone()), |
42 MakeCallDescriptor(test->zone(), return_type), kMachPtr, | 42 MakeCallDescriptor(test->zone(), return_type), |
43 MachineOperatorBuilder::kAllOptionalOps), | 43 MachineType::PointerRepresentation(), |
| 44 MachineOperatorBuilder::kAllOptionalOps), |
44 test_(test) {} | 45 test_(test) {} |
45 StreamBuilder(InstructionSelectorTest* test, MachineType return_type, | 46 StreamBuilder(InstructionSelectorTest* test, MachineType return_type, |
46 MachineType parameter0_type) | 47 MachineType parameter0_type) |
47 : RawMachineAssembler( | 48 : RawMachineAssembler( |
48 test->isolate(), new (test->zone()) Graph(test->zone()), | 49 test->isolate(), new (test->zone()) Graph(test->zone()), |
49 MakeCallDescriptor(test->zone(), return_type, parameter0_type), | 50 MakeCallDescriptor(test->zone(), return_type, parameter0_type), |
50 kMachPtr, MachineOperatorBuilder::kAllOptionalOps), | 51 MachineType::PointerRepresentation(), |
| 52 MachineOperatorBuilder::kAllOptionalOps), |
51 test_(test) {} | 53 test_(test) {} |
52 StreamBuilder(InstructionSelectorTest* test, MachineType return_type, | 54 StreamBuilder(InstructionSelectorTest* test, MachineType return_type, |
53 MachineType parameter0_type, MachineType parameter1_type) | 55 MachineType parameter0_type, MachineType parameter1_type) |
54 : RawMachineAssembler( | 56 : RawMachineAssembler( |
55 test->isolate(), new (test->zone()) Graph(test->zone()), | 57 test->isolate(), new (test->zone()) Graph(test->zone()), |
56 MakeCallDescriptor(test->zone(), return_type, parameter0_type, | 58 MakeCallDescriptor(test->zone(), return_type, parameter0_type, |
57 parameter1_type), | 59 parameter1_type), |
58 kMachPtr, MachineOperatorBuilder::kAllOptionalOps), | 60 MachineType::PointerRepresentation(), |
| 61 MachineOperatorBuilder::kAllOptionalOps), |
59 test_(test) {} | 62 test_(test) {} |
60 StreamBuilder(InstructionSelectorTest* test, MachineType return_type, | 63 StreamBuilder(InstructionSelectorTest* test, MachineType return_type, |
61 MachineType parameter0_type, MachineType parameter1_type, | 64 MachineType parameter0_type, MachineType parameter1_type, |
62 MachineType parameter2_type) | 65 MachineType parameter2_type) |
63 : RawMachineAssembler( | 66 : RawMachineAssembler( |
64 test->isolate(), new (test->zone()) Graph(test->zone()), | 67 test->isolate(), new (test->zone()) Graph(test->zone()), |
65 MakeCallDescriptor(test->zone(), return_type, parameter0_type, | 68 MakeCallDescriptor(test->zone(), return_type, parameter0_type, |
66 parameter1_type, parameter2_type), | 69 parameter1_type, parameter2_type), |
67 kMachPtr, MachineOperatorBuilder::kAllOptionalOps), | 70 MachineType::PointerRepresentation(), |
| 71 MachineOperatorBuilder::kAllOptionalOps), |
68 test_(test) {} | 72 test_(test) {} |
69 | 73 |
70 Stream Build(CpuFeature feature) { | 74 Stream Build(CpuFeature feature) { |
71 return Build(InstructionSelector::Features(feature)); | 75 return Build(InstructionSelector::Features(feature)); |
72 } | 76 } |
73 Stream Build(CpuFeature feature1, CpuFeature feature2) { | 77 Stream Build(CpuFeature feature1, CpuFeature feature2) { |
74 return Build(InstructionSelector::Features(feature1, feature2)); | 78 return Build(InstructionSelector::Features(feature1, feature2)); |
75 } | 79 } |
76 Stream Build(StreamBuilderMode mode = kTargetInstructions) { | 80 Stream Build(StreamBuilderMode mode = kTargetInstructions) { |
77 return Build(InstructionSelector::Features(), mode); | 81 return Build(InstructionSelector::Features(), mode); |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 template <typename T> | 253 template <typename T> |
250 class InstructionSelectorTestWithParam | 254 class InstructionSelectorTestWithParam |
251 : public InstructionSelectorTest, | 255 : public InstructionSelectorTest, |
252 public ::testing::WithParamInterface<T> {}; | 256 public ::testing::WithParamInterface<T> {}; |
253 | 257 |
254 } // namespace compiler | 258 } // namespace compiler |
255 } // namespace internal | 259 } // namespace internal |
256 } // namespace v8 | 260 } // namespace v8 |
257 | 261 |
258 #endif // V8_UNITTESTS_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_ | 262 #endif // V8_UNITTESTS_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_ |
OLD | NEW |