| 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_CALL_TESTER_H_ | 5 #ifndef V8_CCTEST_COMPILER_CALL_TESTER_H_ |
| 6 #define V8_CCTEST_COMPILER_CALL_TESTER_H_ | 6 #define V8_CCTEST_COMPILER_CALL_TESTER_H_ |
| 7 | 7 |
| 8 #include "src/simulator.h" | 8 #include "src/simulator.h" |
| 9 #include "test/cctest/compiler/c-signature.h" | 9 #include "test/cctest/compiler/c-signature.h" |
| 10 | 10 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 return DoCall(FUNCTION_CAST<FType*>(Generate()), p1, p2, p3, p4); | 159 return DoCall(FUNCTION_CAST<FType*>(Generate()), p1, p2, p3, p4); |
| 160 } | 160 } |
| 161 | 161 |
| 162 template <typename P1, typename P2, typename P3, typename P4, typename P5> | 162 template <typename P1, typename P2, typename P3, typename P4, typename P5> |
| 163 R Call(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) { | 163 R Call(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) { |
| 164 typedef R V8_CDECL FType(P1, P2, P3, P4, P5); | 164 typedef R V8_CDECL FType(P1, P2, P3, P4, P5); |
| 165 CSignature::VerifyParams<P1, P2, P3, P4, P5>(csig_); | 165 CSignature::VerifyParams<P1, P2, P3, P4, P5>(csig_); |
| 166 return DoCall(FUNCTION_CAST<FType*>(Generate()), p1, p2, p3, p4, p5); | 166 return DoCall(FUNCTION_CAST<FType*>(Generate()), p1, p2, p3, p4, p5); |
| 167 } | 167 } |
| 168 | 168 |
| 169 CSignature* signature() const { return csig_; } |
| 170 |
| 169 protected: | 171 protected: |
| 170 MachineSignature* csig_; | 172 MachineSignature* csig_; |
| 171 | 173 |
| 172 virtual byte* Generate() = 0; | 174 virtual byte* Generate() = 0; |
| 173 | 175 |
| 174 private: | 176 private: |
| 175 #if USE_SIMULATOR && V8_TARGET_ARCH_ARM64 | 177 #if USE_SIMULATOR && V8_TARGET_ARCH_ARM64 |
| 176 uintptr_t CallSimulator(byte* f, Simulator::CallArgument* args) { | 178 uintptr_t CallSimulator(byte* f, Simulator::CallArgument* args) { |
| 177 Simulator* simulator = Simulator::current(isolate_); | 179 Simulator* simulator = Simulator::current(isolate_); |
| 178 return static_cast<uintptr_t>(simulator->CallInt64(f, args)); | 180 return static_cast<uintptr_t>(simulator->CallInt64(f, args)); |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 private: | 353 private: |
| 352 Handle<Code> code_; | 354 Handle<Code> code_; |
| 353 }; | 355 }; |
| 354 | 356 |
| 355 | 357 |
| 356 } // namespace compiler | 358 } // namespace compiler |
| 357 } // namespace internal | 359 } // namespace internal |
| 358 } // namespace v8 | 360 } // namespace v8 |
| 359 | 361 |
| 360 #endif // V8_CCTEST_COMPILER_CALL_TESTER_H_ | 362 #endif // V8_CCTEST_COMPILER_CALL_TESTER_H_ |
| OLD | NEW |