OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 #include "src/builtins/builtins.h" | 5 #include "src/builtins/builtins.h" |
6 | 6 |
7 #include "src/api-arguments.h" | 7 #include "src/api-arguments.h" |
8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
9 #include "src/builtins/builtins-utils.h" | 9 #include "src/builtins/builtins-utils.h" |
10 | 10 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 if (!is_construct || result->IsJSObject()) return handle(*result, isolate); | 115 if (!is_construct || result->IsJSObject()) return handle(*result, isolate); |
116 } | 116 } |
117 | 117 |
118 return js_receiver; | 118 return js_receiver; |
119 } | 119 } |
120 | 120 |
121 } // anonymous namespace | 121 } // anonymous namespace |
122 | 122 |
123 BUILTIN(HandleApiCall) { | 123 BUILTIN(HandleApiCall) { |
124 HandleScope scope(isolate); | 124 HandleScope scope(isolate); |
125 Handle<JSFunction> function = args.target<JSFunction>(); | 125 Handle<JSFunction> function = args.target(); |
126 Handle<Object> receiver = args.receiver(); | 126 Handle<Object> receiver = args.receiver(); |
127 Handle<HeapObject> new_target = args.new_target(); | 127 Handle<HeapObject> new_target = args.new_target(); |
128 Handle<FunctionTemplateInfo> fun_data(function->shared()->get_api_func_data(), | 128 Handle<FunctionTemplateInfo> fun_data(function->shared()->get_api_func_data(), |
129 isolate); | 129 isolate); |
130 if (new_target->IsJSReceiver()) { | 130 if (new_target->IsJSReceiver()) { |
131 RETURN_RESULT_OR_FAILURE( | 131 RETURN_RESULT_OR_FAILURE( |
132 isolate, HandleApiCallHelper<true>(isolate, function, new_target, | 132 isolate, HandleApiCallHelper<true>(isolate, function, new_target, |
133 fun_data, receiver, args)); | 133 fun_data, receiver, args)); |
134 } else { | 134 } else { |
135 RETURN_RESULT_OR_FAILURE( | 135 RETURN_RESULT_OR_FAILURE( |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 } | 282 } |
283 | 283 |
284 // Handle calls to non-function objects created through the API. This delegate | 284 // Handle calls to non-function objects created through the API. This delegate |
285 // function is used when the call is a construct call. | 285 // function is used when the call is a construct call. |
286 BUILTIN(HandleApiCallAsConstructor) { | 286 BUILTIN(HandleApiCallAsConstructor) { |
287 return HandleApiCallAsFunctionOrConstructor(isolate, true, args); | 287 return HandleApiCallAsFunctionOrConstructor(isolate, true, args); |
288 } | 288 } |
289 | 289 |
290 } // namespace internal | 290 } // namespace internal |
291 } // namespace v8 | 291 } // namespace v8 |
OLD | NEW |