Index: test/cctest/compiler/codegen-tester.h |
diff --git a/test/cctest/compiler/codegen-tester.h b/test/cctest/compiler/codegen-tester.h |
index 5bfdf1f505fab16a41a8e77a196ec14d99fc9d99..55dbecdb9eca8709ebb0d139ca1a1e7ac52fe67f 100644 |
--- a/test/cctest/compiler/codegen-tester.h |
+++ b/test/cctest/compiler/codegen-tester.h |
@@ -77,28 +77,12 @@ template <typename ReturnType> |
class BufferedRawMachineAssemblerTester |
: public RawMachineAssemblerTester<int32_t> { |
public: |
- BufferedRawMachineAssemblerTester() |
- : BufferedRawMachineAssemblerTester(0, kMachNone, kMachNone, kMachNone, |
- kMachNone) {} |
- |
- |
- explicit BufferedRawMachineAssemblerTester(MachineType p0) |
- : BufferedRawMachineAssemblerTester(1, p0, kMachNone, kMachNone, |
- kMachNone) {} |
- |
- |
- BufferedRawMachineAssemblerTester(MachineType p0, MachineType p1) |
- : BufferedRawMachineAssemblerTester(2, p0, p1, kMachNone, kMachNone) {} |
- |
- |
- BufferedRawMachineAssemblerTester(MachineType p0, MachineType p1, |
- MachineType p2) |
- : BufferedRawMachineAssemblerTester(3, p0, p1, p2, kMachNone) {} |
- |
- |
- BufferedRawMachineAssemblerTester(MachineType p0, MachineType p1, |
- MachineType p2, MachineType p3) |
- : BufferedRawMachineAssemblerTester(4, p0, p1, p2, p3) {} |
+ BufferedRawMachineAssemblerTester(MachineType p0 = kMachNone, |
+ MachineType p1 = kMachNone, |
+ MachineType p2 = kMachNone, |
+ MachineType p3 = kMachNone) |
+ : BufferedRawMachineAssemblerTester(ComputeParameterCount(p0, p1, p2, p3), |
+ p0, p1, p2, p3) {} |
// The BufferedRawMachineAssemblerTester does not pass parameters directly |
@@ -193,6 +177,24 @@ class BufferedRawMachineAssemblerTester |
} |
+ static uint32_t ComputeParameterCount(MachineType p0, MachineType p1, |
+ MachineType p2, MachineType p3) { |
+ if (p0 == kMachNone) { |
+ return 0; |
+ } |
+ if (p1 == kMachNone) { |
+ return 1; |
+ } |
+ if (p2 == kMachNone) { |
+ return 2; |
+ } |
+ if (p3 == kMachNone) { |
+ return 3; |
+ } |
+ return 4; |
+ } |
+ |
+ |
CSignature* test_graph_signature_; |
Node* parameter_nodes_[4]; |
uint32_t return_parameter_index_; |