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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 MachineRepresentation p3 = kMachineLast, | 135 MachineRepresentation p3 = kMachineLast, |
136 MachineRepresentation p4 = kMachineLast) | 136 MachineRepresentation p4 = kMachineLast) |
137 : MachineAssemblerTester<StructuredMachineAssembler>( | 137 : MachineAssemblerTester<StructuredMachineAssembler>( |
138 ReturnValueTraits<ReturnType>::Representation(), p0, p1, p2, p3, | 138 ReturnValueTraits<ReturnType>::Representation(), p0, p1, p2, p3, |
139 p4) {} | 139 p4) {} |
140 }; | 140 }; |
141 | 141 |
142 | 142 |
143 static const bool USE_RESULT_BUFFER = true; | 143 static const bool USE_RESULT_BUFFER = true; |
144 static const bool USE_RETURN_REGISTER = false; | 144 static const bool USE_RETURN_REGISTER = false; |
| 145 static const int32_t CHECK_VALUE = 0x99BEEDCE; |
| 146 |
145 | 147 |
146 // TODO(titzer): use the C-style calling convention, or any register-based | 148 // TODO(titzer): use the C-style calling convention, or any register-based |
147 // calling convention for binop tests. | 149 // calling convention for binop tests. |
148 template <typename CType, MachineRepresentation rep, bool use_result_buffer> | 150 template <typename CType, MachineRepresentation rep, bool use_result_buffer> |
149 class BinopTester { | 151 class BinopTester { |
150 public: | 152 public: |
151 static const int32_t CHECK_VALUE = 0x99BEEDCE; | |
152 | |
153 explicit BinopTester(RawMachineAssemblerTester<int32_t>* tester) | 153 explicit BinopTester(RawMachineAssemblerTester<int32_t>* tester) |
154 : T(tester), | 154 : T(tester), |
155 param0(T->LoadFromPointer(&p0, rep)), | 155 param0(T->LoadFromPointer(&p0, rep)), |
156 param1(T->LoadFromPointer(&p1, rep)), | 156 param1(T->LoadFromPointer(&p1, rep)), |
157 p0(static_cast<CType>(0)), | 157 p0(static_cast<CType>(0)), |
158 p1(static_cast<CType>(0)), | 158 p1(static_cast<CType>(0)), |
159 result(static_cast<CType>(0)) {} | 159 result(static_cast<CType>(0)) {} |
160 | 160 |
161 RawMachineAssemblerTester<int32_t>* T; | 161 RawMachineAssemblerTester<int32_t>* T; |
162 Node* param0; | 162 Node* param0; |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 | 346 |
347 void Run(RawMachineAssemblerTester<int32_t>* m); | 347 void Run(RawMachineAssemblerTester<int32_t>* m); |
348 void RunLeft(RawMachineAssemblerTester<int32_t>* m); | 348 void RunLeft(RawMachineAssemblerTester<int32_t>* m); |
349 void RunRight(RawMachineAssemblerTester<int32_t>* m); | 349 void RunRight(RawMachineAssemblerTester<int32_t>* m); |
350 }; | 350 }; |
351 } // namespace compiler | 351 } // namespace compiler |
352 } // namespace internal | 352 } // namespace internal |
353 } // namespace v8 | 353 } // namespace v8 |
354 | 354 |
355 #endif // V8_CCTEST_COMPILER_CODEGEN_TESTER_H_ | 355 #endif // V8_CCTEST_COMPILER_CODEGEN_TESTER_H_ |
OLD | NEW |