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/instruction-selector.h" | 10 #include "src/compiler/instruction-selector.h" |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 : BinopTester<Type*, kMachAnyTagged, USE_RETURN_REGISTER>(tester) {} | 200 : BinopTester<Type*, kMachAnyTagged, USE_RETURN_REGISTER>(tester) {} |
201 }; | 201 }; |
202 | 202 |
203 // A helper class for testing compares. Wraps a machine opcode and provides | 203 // A helper class for testing compares. Wraps a machine opcode and provides |
204 // evaluation routines and the operators. | 204 // evaluation routines and the operators. |
205 class CompareWrapper { | 205 class CompareWrapper { |
206 public: | 206 public: |
207 explicit CompareWrapper(IrOpcode::Value op) : opcode(op) {} | 207 explicit CompareWrapper(IrOpcode::Value op) : opcode(op) {} |
208 | 208 |
209 Node* MakeNode(RawMachineAssemblerTester<int32_t>* m, Node* a, Node* b) { | 209 Node* MakeNode(RawMachineAssemblerTester<int32_t>* m, Node* a, Node* b) { |
210 return m->NewNode(op(m->machine()), a, b); | 210 return m->AddNode(op(m->machine()), a, b); |
211 } | 211 } |
212 | 212 |
213 const Operator* op(MachineOperatorBuilder* machine) { | 213 const Operator* op(MachineOperatorBuilder* machine) { |
214 switch (opcode) { | 214 switch (opcode) { |
215 case IrOpcode::kWord32Equal: | 215 case IrOpcode::kWord32Equal: |
216 return machine->Word32Equal(); | 216 return machine->Word32Equal(); |
217 case IrOpcode::kInt32LessThan: | 217 case IrOpcode::kInt32LessThan: |
218 return machine->Int32LessThan(); | 218 return machine->Int32LessThan(); |
219 case IrOpcode::kInt32LessThanOrEqual: | 219 case IrOpcode::kInt32LessThanOrEqual: |
220 return machine->Int32LessThanOrEqual(); | 220 return machine->Int32LessThanOrEqual(); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 } else { | 315 } else { |
316 CHECK_EQ(x, y); | 316 CHECK_EQ(x, y); |
317 } | 317 } |
318 } | 318 } |
319 | 319 |
320 } // namespace compiler | 320 } // namespace compiler |
321 } // namespace internal | 321 } // namespace internal |
322 } // namespace v8 | 322 } // namespace v8 |
323 | 323 |
324 #endif // V8_CCTEST_COMPILER_CODEGEN_TESTER_H_ | 324 #endif // V8_CCTEST_COMPILER_CODEGEN_TESTER_H_ |
OLD | NEW |