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 // Assumes VoidDescriptor call interface. | 29 FunctionTester(const CallInterfaceDescriptor& descriptor, Handle<Code> code); |
30 explicit FunctionTester(Handle<Code> code); | |
31 | 30 |
32 Isolate* isolate; | 31 Isolate* isolate; |
33 Handle<JSFunction> function; | 32 Handle<JSFunction> function; |
34 | 33 |
35 MaybeHandle<Object> Call(); | 34 MaybeHandle<Object> Call(); |
36 MaybeHandle<Object> Call(Handle<Object> a); | 35 MaybeHandle<Object> Call(Handle<Object> a); |
37 MaybeHandle<Object> Call(Handle<Object> a, Handle<Object> b); | 36 MaybeHandle<Object> Call(Handle<Object> a, Handle<Object> b); |
38 MaybeHandle<Object> Call(Handle<Object> a, Handle<Object> b, | 37 MaybeHandle<Object> Call(Handle<Object> a, Handle<Object> b, |
39 Handle<Object> c); | 38 Handle<Object> c); |
40 MaybeHandle<Object> Call(Handle<Object> a, Handle<Object> b, Handle<Object> c, | 39 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... |
128 | 127 |
129 // Compile the given machine graph instead of the source of the function | 128 // Compile the given machine graph instead of the source of the function |
130 // and replace the JSFunction's code with the result. | 129 // and replace the JSFunction's code with the result. |
131 Handle<JSFunction> CompileGraph(Graph* graph); | 130 Handle<JSFunction> CompileGraph(Graph* graph); |
132 }; | 131 }; |
133 } // namespace compiler | 132 } // namespace compiler |
134 } // namespace internal | 133 } // namespace internal |
135 } // namespace v8 | 134 } // namespace v8 |
136 | 135 |
137 #endif // V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ | 136 #endif // V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ |
OLD | NEW |