Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: src/builtins.cc

Issue 1520843002: Revert of Removes the Callee parameter from FunctionCallbackInfo. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/arm64/code-stubs-arm64.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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.h" 5 #include "src/builtins.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/api-natives.h" 8 #include "src/api-natives.h"
9 #include "src/arguments.h" 9 #include "src/arguments.h"
10 #include "src/base/once.h" 10 #include "src/base/once.h"
(...skipping 1874 matching lines...) Expand 10 before | Expand all | Expand 10 after
1885 Object* callback_obj = call_data->callback(); 1885 Object* callback_obj = call_data->callback();
1886 v8::FunctionCallback callback = 1886 v8::FunctionCallback callback =
1887 v8::ToCData<v8::FunctionCallback>(callback_obj); 1887 v8::ToCData<v8::FunctionCallback>(callback_obj);
1888 Object* data_obj = call_data->data(); 1888 Object* data_obj = call_data->data();
1889 1889
1890 LOG(isolate, ApiObjectAccess("call", JSObject::cast(*args.receiver()))); 1890 LOG(isolate, ApiObjectAccess("call", JSObject::cast(*args.receiver())));
1891 DCHECK(raw_holder->IsJSObject()); 1891 DCHECK(raw_holder->IsJSObject());
1892 1892
1893 FunctionCallbackArguments custom(isolate, 1893 FunctionCallbackArguments custom(isolate,
1894 data_obj, 1894 data_obj,
1895 *function,
1895 raw_holder, 1896 raw_holder,
1896 &args[0] - 1, 1897 &args[0] - 1,
1897 args.length() - 1, 1898 args.length() - 1,
1898 is_construct); 1899 is_construct);
1899 1900
1900 v8::Local<v8::Value> value = custom.Call(callback); 1901 v8::Local<v8::Value> value = custom.Call(callback);
1901 Handle<Object> result; 1902 Handle<Object> result;
1902 if (value.IsEmpty()) { 1903 if (value.IsEmpty()) {
1903 result = isolate->factory()->undefined_value(); 1904 result = isolate->factory()->undefined_value();
1904 } else { 1905 } else {
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
2047 v8::ToCData<v8::FunctionCallback>(callback_obj); 2048 v8::ToCData<v8::FunctionCallback>(callback_obj);
2048 2049
2049 // Get the data for the call and perform the callback. 2050 // Get the data for the call and perform the callback.
2050 Object* result; 2051 Object* result;
2051 { 2052 {
2052 HandleScope scope(isolate); 2053 HandleScope scope(isolate);
2053 LOG(isolate, ApiObjectAccess("call non-function", obj)); 2054 LOG(isolate, ApiObjectAccess("call non-function", obj));
2054 2055
2055 FunctionCallbackArguments custom(isolate, 2056 FunctionCallbackArguments custom(isolate,
2056 call_data->data(), 2057 call_data->data(),
2058 constructor,
2057 obj, 2059 obj,
2058 &args[0] - 1, 2060 &args[0] - 1,
2059 args.length() - 1, 2061 args.length() - 1,
2060 is_construct_call); 2062 is_construct_call);
2061 v8::Local<v8::Value> value = custom.Call(callback); 2063 v8::Local<v8::Value> value = custom.Call(callback);
2062 if (value.IsEmpty()) { 2064 if (value.IsEmpty()) {
2063 result = heap->undefined_value(); 2065 result = heap->undefined_value();
2064 } else { 2066 } else {
2065 result = *reinterpret_cast<Object**>(*value); 2067 result = *reinterpret_cast<Object**>(*value);
2066 result->VerifyApiCallResultType(); 2068 result->VerifyApiCallResultType();
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
2435 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) 2437 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C)
2436 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) 2438 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A)
2437 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) 2439 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H)
2438 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) 2440 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
2439 #undef DEFINE_BUILTIN_ACCESSOR_C 2441 #undef DEFINE_BUILTIN_ACCESSOR_C
2440 #undef DEFINE_BUILTIN_ACCESSOR_A 2442 #undef DEFINE_BUILTIN_ACCESSOR_A
2441 2443
2442 2444
2443 } // namespace internal 2445 } // namespace internal
2444 } // namespace v8 2446 } // namespace v8
OLDNEW
« no previous file with comments | « src/arm64/code-stubs-arm64.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698