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_FUNCTION_TESTER_H_ | 5 #ifndef V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ |
6 #define V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ | 6 #define V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ |
7 | 7 |
8 #include "src/handles.h" | 8 #include "src/handles.h" |
9 #include "test/cctest/cctest.h" | 9 #include "test/cctest/cctest.h" |
10 | 10 |
11 namespace v8 { | 11 namespace v8 { |
12 namespace internal { | 12 namespace internal { |
13 | 13 |
14 class CallInterfaceDescriptor; | 14 class CallInterfaceDescriptor; |
15 class Isolate; | 15 class Isolate; |
16 | 16 |
17 namespace compiler { | 17 namespace compiler { |
18 | 18 |
19 class Graph; | 19 class Graph; |
20 | 20 |
21 class FunctionTester : public InitializedHandleScope { | 21 class FunctionTester : public InitializedHandleScope { |
22 public: | 22 public: |
23 explicit FunctionTester(const char* source, uint32_t flags = 0); | 23 explicit FunctionTester(const char* source, uint32_t flags = 0); |
24 | 24 |
25 FunctionTester(Graph* graph, int param_count); | 25 FunctionTester(Graph* graph, int param_count); |
26 | 26 |
27 FunctionTester(Handle<Code> code, int param_count); | 27 FunctionTester(Handle<Code> code, int param_count); |
28 | 28 |
29 FunctionTester(const CallInterfaceDescriptor& descriptor, Handle<Code> code); | 29 // Assumes VoidDescriptor call interface. |
| 30 explicit FunctionTester(Handle<Code> code); |
30 | 31 |
31 Isolate* isolate; | 32 Isolate* isolate; |
32 Handle<JSFunction> function; | 33 Handle<JSFunction> function; |
33 | 34 |
34 MaybeHandle<Object> Call(); | 35 MaybeHandle<Object> Call(); |
35 MaybeHandle<Object> Call(Handle<Object> a); | 36 MaybeHandle<Object> Call(Handle<Object> a); |
36 MaybeHandle<Object> Call(Handle<Object> a, Handle<Object> b); | 37 MaybeHandle<Object> Call(Handle<Object> a, Handle<Object> b); |
37 MaybeHandle<Object> Call(Handle<Object> a, Handle<Object> b, | 38 MaybeHandle<Object> Call(Handle<Object> a, Handle<Object> b, |
38 Handle<Object> c); | 39 Handle<Object> c); |
39 MaybeHandle<Object> Call(Handle<Object> a, Handle<Object> b, Handle<Object> c, | 40 MaybeHandle<Object> Call(Handle<Object> a, Handle<Object> b, Handle<Object> c, |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 128 |
128 // Compile the given machine graph instead of the source of the function | 129 // Compile the given machine graph instead of the source of the function |
129 // and replace the JSFunction's code with the result. | 130 // and replace the JSFunction's code with the result. |
130 Handle<JSFunction> CompileGraph(Graph* graph); | 131 Handle<JSFunction> CompileGraph(Graph* graph); |
131 }; | 132 }; |
132 } // namespace compiler | 133 } // namespace compiler |
133 } // namespace internal | 134 } // namespace internal |
134 } // namespace v8 | 135 } // namespace v8 |
135 | 136 |
136 #endif // V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ | 137 #endif // V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ |
OLD | NEW |