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

Unified Diff: src/builtins.cc

Issue 12494012: new style of property/function callbacks (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebase Created 7 years, 8 months 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 side-by-side diff with in-line comments
Download patch
Index: src/builtins.cc
diff --git a/src/builtins.cc b/src/builtins.cc
index fe2592deb8bbc7e43bf7adef0e34a47f59e8ea03..f101d2a331feb0c2678c0b76f47c3a996af22bac 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -1308,12 +1308,8 @@ MUST_USE_RESULT static MaybeObject* HandleApiCallHelper(
LOG(isolate, ApiObjectAccess("call", JSObject::cast(*args.receiver())));
ASSERT(raw_holder->IsJSObject());
- CustomArguments custom(isolate);
- v8::ImplementationUtilities::PrepareArgumentsData(custom.end(),
- isolate, data_obj, *function, raw_holder);
-
- v8::Arguments new_args = v8::ImplementationUtilities::NewArguments(
- custom.end(),
+ FunctionCallbackArguments custom(isolate, data_obj, *function, raw_holder);
+ v8::Arguments new_args = custom.NewArguments(
&args[0] - 1,
args.length() - 1,
is_construct);
@@ -1324,7 +1320,7 @@ MUST_USE_RESULT static MaybeObject* HandleApiCallHelper(
VMState<EXTERNAL> state(isolate);
ExternalCallbackScope call_scope(isolate,
v8::ToCData<Address>(callback_obj));
- value = callback(new_args);
+ value = custom.GetCallbackResult(isolate, callback, callback(new_args));
}
if (value.IsEmpty()) {
result = heap->undefined_value();
@@ -1387,11 +1383,9 @@ MUST_USE_RESULT static MaybeObject* HandleApiCallAsFunctionOrConstructor(
HandleScope scope(isolate);
LOG(isolate, ApiObjectAccess("call non-function", obj));
- CustomArguments custom(isolate);
- v8::ImplementationUtilities::PrepareArgumentsData(custom.end(),
- isolate, call_data->data(), constructor, obj);
- v8::Arguments new_args = v8::ImplementationUtilities::NewArguments(
- custom.end(),
+ FunctionCallbackArguments
+ custom(isolate, call_data->data(), constructor, obj);
+ v8::Arguments new_args = custom.NewArguments(
&args[0] - 1,
args.length() - 1,
is_construct_call);
@@ -1401,7 +1395,7 @@ MUST_USE_RESULT static MaybeObject* HandleApiCallAsFunctionOrConstructor(
VMState<EXTERNAL> state(isolate);
ExternalCallbackScope call_scope(isolate,
v8::ToCData<Address>(callback_obj));
- value = callback(new_args);
+ value = custom.GetCallbackResult(isolate, callback, callback(new_args));
}
if (value.IsEmpty()) {
result = heap->undefined_value();
« no previous file with comments | « src/arguments.h ('k') | src/handles.cc » ('j') | src/x64/macro-assembler-x64.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698