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/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/simulator.h" | 10 #include "src/simulator.h" |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 } | 297 } |
298 template <typename F, typename P1, typename P2, typename P3, typename P4> | 298 template <typename F, typename P1, typename P2, typename P3, typename P4> |
299 R DoCall(F* f, P1 p1, P2 p2, P3 p3, P4 p4) { | 299 R DoCall(F* f, P1 p1, P2 p2, P3 p3, P4 p4) { |
300 return f(p1, p2, p3, p4); | 300 return f(p1, p2, p3, p4); |
301 } | 301 } |
302 #endif | 302 #endif |
303 | 303 |
304 Isolate* isolate_; | 304 Isolate* isolate_; |
305 }; | 305 }; |
306 | 306 |
307 // A call helper that calls the given code object assuming C calling convention. | |
308 template <typename T> | |
309 class CodeRunner : public CallHelper<T> { | |
310 public: | |
311 CodeRunner(Isolate* isolate, Handle<Code> code, CSignature* csig) | |
312 : CallHelper<T>(isolate, csig), code_(code) {} | |
313 virtual ~CodeRunner() {} | |
314 | |
315 virtual byte* Generate() { return code_->entry(); } | |
316 | |
317 private: | |
318 Handle<Code> code_; | |
319 }; | |
320 | |
321 | |
322 } // namespace compiler | 307 } // namespace compiler |
323 } // namespace internal | 308 } // namespace internal |
324 } // namespace v8 | 309 } // namespace v8 |
325 | 310 |
326 #endif // V8_CCTEST_COMPILER_CALL_TESTER_H_ | 311 #endif // V8_CCTEST_COMPILER_CALL_TESTER_H_ |
OLD | NEW |