Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: test/unittests/compiler/instruction-selector-unittest.h

Issue 1128133003: [turbofan] Make an OptionalOperator for MachineOperatorBuilder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: OPTIONAL macro Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 template <typename T> 250 template <typename T>
247 class InstructionSelectorTestWithParam 251 class InstructionSelectorTestWithParam
248 : public InstructionSelectorTest, 252 : public InstructionSelectorTest,
249 public ::testing::WithParamInterface<T> {}; 253 public ::testing::WithParamInterface<T> {};
250 254
251 } // namespace compiler 255 } // namespace compiler
252 } // namespace internal 256 } // namespace internal
253 } // namespace v8 257 } // namespace v8
254 258
255 #endif // V8_UNITTESTS_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_ 259 #endif // V8_UNITTESTS_COMPILER_INSTRUCTION_SELECTOR_UNITTEST_H_
OLDNEW
« no previous file with comments | « test/cctest/compiler/test-run-machops.cc ('k') | test/unittests/compiler/machine-operator-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698