| 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_CCTEST_COMPILER_CODEGEN_TESTER_H_ | 5 #ifndef V8_CCTEST_COMPILER_CODEGEN_TESTER_H_ |
| 6 #define V8_CCTEST_COMPILER_CODEGEN_TESTER_H_ | 6 #define V8_CCTEST_COMPILER_CODEGEN_TESTER_H_ |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/compiler/pipeline.h" | 10 #include "src/compiler/pipeline.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 template <typename ReturnType> | 91 template <typename ReturnType> |
| 92 class RawMachineAssemblerTester | 92 class RawMachineAssemblerTester |
| 93 : public MachineAssemblerTester<RawMachineAssembler>, | 93 : public MachineAssemblerTester<RawMachineAssembler>, |
| 94 public CallHelper2<ReturnType, RawMachineAssemblerTester<ReturnType> > { | 94 public CallHelper2<ReturnType, RawMachineAssemblerTester<ReturnType> > { |
| 95 public: | 95 public: |
| 96 RawMachineAssemblerTester(MachineRepresentation p0 = kMachineLast, | 96 RawMachineAssemblerTester(MachineRepresentation p0 = kMachineLast, |
| 97 MachineRepresentation p1 = kMachineLast, | 97 MachineRepresentation p1 = kMachineLast, |
| 98 MachineRepresentation p2 = kMachineLast, | 98 MachineRepresentation p2 = kMachineLast, |
| 99 MachineRepresentation p3 = kMachineLast, | 99 MachineRepresentation p3 = kMachineLast, |
| 100 MachineRepresentation p4 = kMachineLast) | 100 MachineRepresentation p4 = kMachineLast) |
| 101 : MachineAssemblerTester(ReturnValueTraits<ReturnType>::Representation(), | 101 : MachineAssemblerTester<RawMachineAssembler>( |
| 102 p0, p1, p2, p3, p4) {} | 102 ReturnValueTraits<ReturnType>::Representation(), p0, p1, p2, p3, |
| 103 p4) {} |
| 103 }; | 104 }; |
| 104 | 105 |
| 105 | 106 |
| 106 template <typename ReturnType> | 107 template <typename ReturnType> |
| 107 class StructuredMachineAssemblerTester | 108 class StructuredMachineAssemblerTester |
| 108 : public MachineAssemblerTester<StructuredMachineAssembler>, | 109 : public MachineAssemblerTester<StructuredMachineAssembler>, |
| 109 public CallHelper2<ReturnType, | 110 public CallHelper2<ReturnType, |
| 110 StructuredMachineAssemblerTester<ReturnType> > { | 111 StructuredMachineAssemblerTester<ReturnType> > { |
| 111 public: | 112 public: |
| 112 StructuredMachineAssemblerTester(MachineRepresentation p0 = kMachineLast, | 113 StructuredMachineAssemblerTester(MachineRepresentation p0 = kMachineLast, |
| 113 MachineRepresentation p1 = kMachineLast, | 114 MachineRepresentation p1 = kMachineLast, |
| 114 MachineRepresentation p2 = kMachineLast, | 115 MachineRepresentation p2 = kMachineLast, |
| 115 MachineRepresentation p3 = kMachineLast, | 116 MachineRepresentation p3 = kMachineLast, |
| 116 MachineRepresentation p4 = kMachineLast) | 117 MachineRepresentation p4 = kMachineLast) |
| 117 : MachineAssemblerTester(ReturnValueTraits<ReturnType>::Representation(), | 118 : MachineAssemblerTester<StructuredMachineAssembler>( |
| 118 p0, p1, p2, p3, p4) {} | 119 ReturnValueTraits<ReturnType>::Representation(), p0, p1, p2, p3, |
| 120 p4) {} |
| 119 }; | 121 }; |
| 120 | 122 |
| 121 | 123 |
| 122 static const bool USE_RESULT_BUFFER = true; | 124 static const bool USE_RESULT_BUFFER = true; |
| 123 static const bool USE_RETURN_REGISTER = false; | 125 static const bool USE_RETURN_REGISTER = false; |
| 124 | 126 |
| 125 // TODO(titzer): use the C-style calling convention, or any register-based | 127 // TODO(titzer): use the C-style calling convention, or any register-based |
| 126 // calling convention for binop tests. | 128 // calling convention for binop tests. |
| 127 template <typename CType, MachineRepresentation rep, bool use_result_buffer> | 129 template <typename CType, MachineRepresentation rep, bool use_result_buffer> |
| 128 class BinopTester { | 130 class BinopTester { |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 | 316 |
| 315 void Run(RawMachineAssemblerTester<int32_t>* m); | 317 void Run(RawMachineAssemblerTester<int32_t>* m); |
| 316 void RunLeft(RawMachineAssemblerTester<int32_t>* m); | 318 void RunLeft(RawMachineAssemblerTester<int32_t>* m); |
| 317 void RunRight(RawMachineAssemblerTester<int32_t>* m); | 319 void RunRight(RawMachineAssemblerTester<int32_t>* m); |
| 318 }; | 320 }; |
| 319 } // namespace compiler | 321 } // namespace compiler |
| 320 } // namespace internal | 322 } // namespace internal |
| 321 } // namespace v8 | 323 } // namespace v8 |
| 322 | 324 |
| 323 #endif // V8_CCTEST_COMPILER_CODEGEN_TESTER_H_ | 325 #endif // V8_CCTEST_COMPILER_CODEGEN_TESTER_H_ |
| OLD | NEW |