| 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/ast/ast-numbering.h" | 8 #include "src/ast/ast-numbering.h" |
| 9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
| 10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 FunctionTester(const CallInterfaceDescriptor& descriptor, Handle<Code> code) | 54 FunctionTester(const CallInterfaceDescriptor& descriptor, Handle<Code> code) |
| 55 : FunctionTester(code, descriptor.GetParameterCount()) {} | 55 : FunctionTester(code, descriptor.GetParameterCount()) {} |
| 56 | 56 |
| 57 Isolate* isolate; | 57 Isolate* isolate; |
| 58 Handle<JSFunction> function; | 58 Handle<JSFunction> function; |
| 59 | 59 |
| 60 MaybeHandle<Object> Call() { | 60 MaybeHandle<Object> Call() { |
| 61 return Execution::Call(isolate, function, undefined(), 0, nullptr); | 61 return Execution::Call(isolate, function, undefined(), 0, nullptr); |
| 62 } | 62 } |
| 63 | 63 |
| 64 MaybeHandle<Object> Call(Handle<Object> a) { |
| 65 Handle<Object> args[] = {a}; |
| 66 return Execution::Call(isolate, function, undefined(), 1, args); |
| 67 } |
| 68 |
| 64 MaybeHandle<Object> Call(Handle<Object> a, Handle<Object> b) { | 69 MaybeHandle<Object> Call(Handle<Object> a, Handle<Object> b) { |
| 65 Handle<Object> args[] = {a, b}; | 70 Handle<Object> args[] = {a, b}; |
| 66 return Execution::Call(isolate, function, undefined(), 2, args); | 71 return Execution::Call(isolate, function, undefined(), 2, args); |
| 67 } | 72 } |
| 68 | 73 |
| 69 MaybeHandle<Object> Call(Handle<Object> a, Handle<Object> b, | 74 MaybeHandle<Object> Call(Handle<Object> a, Handle<Object> b, |
| 70 Handle<Object> c) { | 75 Handle<Object> c) { |
| 71 Handle<Object> args[] = {a, b, c}; | 76 Handle<Object> args[] = {a, b, c}; |
| 72 return Execution::Call(isolate, function, undefined(), 3, args); | 77 return Execution::Call(isolate, function, undefined(), 3, args); |
| 73 } | 78 } |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 CHECK(!code.is_null()); | 259 CHECK(!code.is_null()); |
| 255 function->ReplaceCode(*code); | 260 function->ReplaceCode(*code); |
| 256 return function; | 261 return function; |
| 257 } | 262 } |
| 258 }; | 263 }; |
| 259 } // namespace compiler | 264 } // namespace compiler |
| 260 } // namespace internal | 265 } // namespace internal |
| 261 } // namespace v8 | 266 } // namespace v8 |
| 262 | 267 |
| 263 #endif // V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ | 268 #endif // V8_CCTEST_COMPILER_FUNCTION_TESTER_H_ |
| OLD | NEW |