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 12 matching lines...) Expand all Loading... |
23 public RawMachineAssembler { | 23 public RawMachineAssembler { |
24 public: | 24 public: |
25 RawMachineAssemblerTester(MachineType p0 = kMachNone, | 25 RawMachineAssemblerTester(MachineType p0 = kMachNone, |
26 MachineType p1 = kMachNone, | 26 MachineType p1 = kMachNone, |
27 MachineType p2 = kMachNone, | 27 MachineType p2 = kMachNone, |
28 MachineType p3 = kMachNone, | 28 MachineType p3 = kMachNone, |
29 MachineType p4 = kMachNone) | 29 MachineType p4 = kMachNone) |
30 : HandleAndZoneScope(), | 30 : HandleAndZoneScope(), |
31 CallHelper<ReturnType>( | 31 CallHelper<ReturnType>( |
32 main_isolate(), | 32 main_isolate(), |
33 MakeMachineSignature( | 33 MakeMachineSignature(main_zone(), MachineTypeForC<ReturnType>(), p0, |
34 main_zone(), ReturnValueTraits<ReturnType>::Representation(), | 34 p1, p2, p3, p4)), |
35 p0, p1, p2, p3, p4)), | |
36 RawMachineAssembler( | 35 RawMachineAssembler( |
37 main_isolate(), new (main_zone()) Graph(main_zone()), | 36 main_isolate(), new (main_zone()) Graph(main_zone()), |
38 MakeMachineSignature( | 37 MakeMachineSignature(main_zone(), MachineTypeForC<ReturnType>(), p0, |
39 main_zone(), ReturnValueTraits<ReturnType>::Representation(), | 38 p1, p2, p3, p4), |
40 p0, p1, p2, p3, p4), | |
41 kMachPtr, InstructionSelector::SupportedMachineOperatorFlags()) {} | 39 kMachPtr, InstructionSelector::SupportedMachineOperatorFlags()) {} |
42 | 40 |
43 void CheckNumber(double expected, Object* number) { | 41 void CheckNumber(double expected, Object* number) { |
44 CHECK(this->isolate()->factory()->NewNumber(expected)->SameValue(number)); | 42 CHECK(this->isolate()->factory()->NewNumber(expected)->SameValue(number)); |
45 } | 43 } |
46 | 44 |
47 void CheckString(const char* expected, Object* string) { | 45 void CheckString(const char* expected, Object* string) { |
48 CHECK( | 46 CHECK( |
49 this->isolate()->factory()->InternalizeUtf8String(expected)->SameValue( | 47 this->isolate()->factory()->InternalizeUtf8String(expected)->SameValue( |
50 string)); | 48 string)); |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 } else { | 333 } else { |
336 CHECK_EQ(x, y); | 334 CHECK_EQ(x, y); |
337 } | 335 } |
338 } | 336 } |
339 | 337 |
340 } // namespace compiler | 338 } // namespace compiler |
341 } // namespace internal | 339 } // namespace internal |
342 } // namespace v8 | 340 } // namespace v8 |
343 | 341 |
344 #endif // V8_CCTEST_COMPILER_CODEGEN_TESTER_H_ | 342 #endif // V8_CCTEST_COMPILER_CODEGEN_TESTER_H_ |
OLD | NEW |