| Index: src/objects.cc
|
| diff --git a/src/objects.cc b/src/objects.cc
|
| index bc05dd5e6dd7853c6251ac2cac1569cd6289ebbb..9e6a44c5053090db441a457823f5c4357617f2d8 100644
|
| --- a/src/objects.cc
|
| +++ b/src/objects.cc
|
| @@ -339,13 +339,14 @@ MaybeObject* JSObject::GetPropertyWithCallback(Object* receiver,
|
| JSObject* self = JSObject::cast(receiver);
|
| Handle<String> key(String::cast(name));
|
| LOG(isolate, ApiNamedPropertyAccess("load", self, name));
|
| - CustomArguments args(isolate, data->data(), self, this);
|
| - v8::AccessorInfo info(args.end());
|
| + PropertyCallbackArguments args(isolate, data->data(), self, this);
|
| + v8::AccessorInfo info = args.NewInfo();
|
| v8::Handle<v8::Value> result;
|
| {
|
| // Leaving JavaScript.
|
| VMState<EXTERNAL> state(isolate);
|
| - result = call_fun(v8::Utils::ToLocal(key), info);
|
| + result = args.GetCallbackResult(
|
| + isolate, call_fun, call_fun(v8::Utils::ToLocal(key), info));
|
| }
|
| RETURN_IF_SCHEDULED_EXCEPTION(isolate);
|
| if (result.IsEmpty()) {
|
| @@ -2112,8 +2113,8 @@ MaybeObject* JSObject::SetPropertyWithInterceptor(
|
| Handle<InterceptorInfo> interceptor(GetNamedInterceptor());
|
| if (!interceptor->setter()->IsUndefined()) {
|
| LOG(isolate, ApiNamedPropertyAccess("interceptor-named-set", this, name));
|
| - CustomArguments args(isolate, interceptor->data(), this, this);
|
| - v8::AccessorInfo info(args.end());
|
| + PropertyCallbackArguments args(isolate, interceptor->data(), this, this);
|
| + v8::AccessorInfo info = args.NewInfo();
|
| v8::NamedPropertySetter setter =
|
| v8::ToCData<v8::NamedPropertySetter>(interceptor->setter());
|
| v8::Handle<v8::Value> result;
|
| @@ -2124,9 +2125,12 @@ MaybeObject* JSObject::SetPropertyWithInterceptor(
|
| isolate->heap()->undefined_value() :
|
| value,
|
| isolate);
|
| - result = setter(v8::Utils::ToLocal(name_handle),
|
| - v8::Utils::ToLocal(value_unhole),
|
| - info);
|
| + result = args.GetCallbackResult(
|
| + isolate,
|
| + setter,
|
| + setter(v8::Utils::ToLocal(name_handle),
|
| + v8::Utils::ToLocal(value_unhole),
|
| + info));
|
| }
|
| RETURN_IF_SCHEDULED_EXCEPTION(isolate);
|
| if (!result.IsEmpty()) return *value_handle;
|
| @@ -2226,8 +2230,9 @@ MaybeObject* JSObject::SetPropertyWithCallback(Object* structure,
|
| if (call_fun == NULL) return value;
|
| Handle<String> key(String::cast(name));
|
| LOG(isolate, ApiNamedPropertyAccess("store", this, name));
|
| - CustomArguments args(isolate, data->data(), this, JSObject::cast(holder));
|
| - v8::AccessorInfo info(args.end());
|
| + PropertyCallbackArguments
|
| + args(isolate, data->data(), this, JSObject::cast(holder));
|
| + v8::AccessorInfo info = args.NewInfo();
|
| {
|
| // Leaving JavaScript.
|
| VMState<EXTERNAL> state(isolate);
|
| @@ -3484,8 +3489,8 @@ PropertyAttributes JSObject::GetPropertyAttributeWithInterceptor(
|
| Handle<JSObject> receiver_handle(receiver);
|
| Handle<JSObject> holder_handle(this);
|
| Handle<String> name_handle(String::cast(name));
|
| - CustomArguments args(isolate, interceptor->data(), receiver, this);
|
| - v8::AccessorInfo info(args.end());
|
| + PropertyCallbackArguments args(isolate, interceptor->data(), receiver, this);
|
| + v8::AccessorInfo info = args.NewInfo();
|
| if (!interceptor->query()->IsUndefined()) {
|
| v8::NamedPropertyQuery query =
|
| v8::ToCData<v8::NamedPropertyQuery>(interceptor->query());
|
| @@ -3495,7 +3500,8 @@ PropertyAttributes JSObject::GetPropertyAttributeWithInterceptor(
|
| {
|
| // Leaving JavaScript.
|
| VMState<EXTERNAL> state(isolate);
|
| - result = query(v8::Utils::ToLocal(name_handle), info);
|
| + result = args.GetCallbackResult(
|
| + isolate, query, query(v8::Utils::ToLocal(name_handle), info));
|
| }
|
| if (!result.IsEmpty()) {
|
| ASSERT(result->IsInt32());
|
| @@ -3510,7 +3516,8 @@ PropertyAttributes JSObject::GetPropertyAttributeWithInterceptor(
|
| {
|
| // Leaving JavaScript.
|
| VMState<EXTERNAL> state(isolate);
|
| - result = getter(v8::Utils::ToLocal(name_handle), info);
|
| + result = args.GetCallbackResult(
|
| + isolate, getter, getter(v8::Utils::ToLocal(name_handle), info));
|
| }
|
| if (!result.IsEmpty()) return DONT_ENUM;
|
| }
|
| @@ -3625,8 +3632,8 @@ PropertyAttributes JSObject::GetElementAttributeWithInterceptor(
|
| Handle<InterceptorInfo> interceptor(GetIndexedInterceptor());
|
| Handle<JSReceiver> hreceiver(receiver);
|
| Handle<JSObject> holder(this);
|
| - CustomArguments args(isolate, interceptor->data(), receiver, this);
|
| - v8::AccessorInfo info(args.end());
|
| + PropertyCallbackArguments args(isolate, interceptor->data(), receiver, this);
|
| + v8::AccessorInfo info = args.NewInfo();
|
| if (!interceptor->query()->IsUndefined()) {
|
| v8::IndexedPropertyQuery query =
|
| v8::ToCData<v8::IndexedPropertyQuery>(interceptor->query());
|
| @@ -3636,7 +3643,7 @@ PropertyAttributes JSObject::GetElementAttributeWithInterceptor(
|
| {
|
| // Leaving JavaScript.
|
| VMState<EXTERNAL> state(isolate);
|
| - result = query(index, info);
|
| + result = args.GetCallbackResult(isolate, query, query(index, info));
|
| }
|
| if (!result.IsEmpty())
|
| return static_cast<PropertyAttributes>(result->Int32Value());
|
| @@ -3649,7 +3656,7 @@ PropertyAttributes JSObject::GetElementAttributeWithInterceptor(
|
| {
|
| // Leaving JavaScript.
|
| VMState<EXTERNAL> state(isolate);
|
| - result = getter(index, info);
|
| + result = args.GetCallbackResult(isolate, getter, getter(index, info));
|
| }
|
| if (!result.IsEmpty()) return NONE;
|
| }
|
| @@ -4313,13 +4320,14 @@ MaybeObject* JSObject::DeletePropertyWithInterceptor(Name* name) {
|
| v8::ToCData<v8::NamedPropertyDeleter>(interceptor->deleter());
|
| LOG(isolate,
|
| ApiNamedPropertyAccess("interceptor-named-delete", *this_handle, name));
|
| - CustomArguments args(isolate, interceptor->data(), this, this);
|
| - v8::AccessorInfo info(args.end());
|
| + PropertyCallbackArguments args(isolate, interceptor->data(), this, this);
|
| + v8::AccessorInfo info = args.NewInfo();
|
| v8::Handle<v8::Boolean> result;
|
| {
|
| // Leaving JavaScript.
|
| VMState<EXTERNAL> state(isolate);
|
| - result = deleter(v8::Utils::ToLocal(name_handle), info);
|
| + result = args.GetCallbackResult(
|
| + isolate, deleter, deleter(v8::Utils::ToLocal(name_handle), info));
|
| }
|
| RETURN_IF_SCHEDULED_EXCEPTION(isolate);
|
| if (!result.IsEmpty()) {
|
| @@ -4350,13 +4358,13 @@ MaybeObject* JSObject::DeleteElementWithInterceptor(uint32_t index) {
|
| Handle<JSObject> this_handle(this);
|
| LOG(isolate,
|
| ApiIndexedPropertyAccess("interceptor-indexed-delete", this, index));
|
| - CustomArguments args(isolate, interceptor->data(), this, this);
|
| - v8::AccessorInfo info(args.end());
|
| + PropertyCallbackArguments args(isolate, interceptor->data(), this, this);
|
| + v8::AccessorInfo info = args.NewInfo();
|
| v8::Handle<v8::Boolean> result;
|
| {
|
| // Leaving JavaScript.
|
| VMState<EXTERNAL> state(isolate);
|
| - result = deleter(index, info);
|
| + result = args.GetCallbackResult(isolate, deleter, deleter(index, info));
|
| }
|
| RETURN_IF_SCHEDULED_EXCEPTION(isolate);
|
| if (!result.IsEmpty()) {
|
| @@ -10284,13 +10292,16 @@ MaybeObject* JSObject::SetElementWithInterceptor(uint32_t index,
|
| v8::ToCData<v8::IndexedPropertySetter>(interceptor->setter());
|
| LOG(isolate,
|
| ApiIndexedPropertyAccess("interceptor-indexed-set", this, index));
|
| - CustomArguments args(isolate, interceptor->data(), this, this);
|
| - v8::AccessorInfo info(args.end());
|
| + PropertyCallbackArguments args(isolate, interceptor->data(), this, this);
|
| + v8::AccessorInfo info = args.NewInfo();
|
| v8::Handle<v8::Value> result;
|
| {
|
| // Leaving JavaScript.
|
| VMState<EXTERNAL> state(isolate);
|
| - result = setter(index, v8::Utils::ToLocal(value_handle), info);
|
| + result = args.GetCallbackResult(
|
| + isolate,
|
| + setter,
|
| + setter(index, v8::Utils::ToLocal(value_handle), info));
|
| }
|
| RETURN_IF_SCHEDULED_EXCEPTION(isolate);
|
| if (!result.IsEmpty()) return *value_handle;
|
| @@ -10327,13 +10338,15 @@ MaybeObject* JSObject::GetElementWithCallback(Object* receiver,
|
| Handle<Object> number = isolate->factory()->NewNumberFromUint(index);
|
| Handle<String> key = isolate->factory()->NumberToString(number);
|
| LOG(isolate, ApiNamedPropertyAccess("load", *self, *key));
|
| - CustomArguments args(isolate, data->data(), *self, *holder_handle);
|
| - v8::AccessorInfo info(args.end());
|
| + PropertyCallbackArguments
|
| + args(isolate, data->data(), *self, *holder_handle);
|
| + v8::AccessorInfo info = args.NewInfo();
|
| v8::Handle<v8::Value> result;
|
| {
|
| // Leaving JavaScript.
|
| VMState<EXTERNAL> state(isolate);
|
| - result = call_fun(v8::Utils::ToLocal(key), info);
|
| + result = args.GetCallbackResult(
|
| + isolate, call_fun, call_fun(v8::Utils::ToLocal(key), info));
|
| }
|
| RETURN_IF_SCHEDULED_EXCEPTION(isolate);
|
| if (result.IsEmpty()) return isolate->heap()->undefined_value();
|
| @@ -10394,8 +10407,9 @@ MaybeObject* JSObject::SetElementWithCallback(Object* structure,
|
| Handle<Object> number = isolate->factory()->NewNumberFromUint(index);
|
| Handle<String> key(isolate->factory()->NumberToString(number));
|
| LOG(isolate, ApiNamedPropertyAccess("store", *self, *key));
|
| - CustomArguments args(isolate, data->data(), *self, *holder_handle);
|
| - v8::AccessorInfo info(args.end());
|
| + PropertyCallbackArguments
|
| + args(isolate, data->data(), *self, *holder_handle);
|
| + v8::AccessorInfo info = args.NewInfo();
|
| {
|
| // Leaving JavaScript.
|
| VMState<EXTERNAL> state(isolate);
|
| @@ -11273,13 +11287,14 @@ MaybeObject* JSObject::GetElementWithInterceptor(Object* receiver,
|
| v8::ToCData<v8::IndexedPropertyGetter>(interceptor->getter());
|
| LOG(isolate,
|
| ApiIndexedPropertyAccess("interceptor-indexed-get", this, index));
|
| - CustomArguments args(isolate, interceptor->data(), receiver, this);
|
| - v8::AccessorInfo info(args.end());
|
| + PropertyCallbackArguments
|
| + args(isolate, interceptor->data(), receiver, this);
|
| + v8::AccessorInfo info = args.NewInfo();
|
| v8::Handle<v8::Value> result;
|
| {
|
| // Leaving JavaScript.
|
| VMState<EXTERNAL> state(isolate);
|
| - result = getter(index, info);
|
| + result = args.GetCallbackResult(isolate, getter, getter(index, info));
|
| }
|
| RETURN_IF_SCHEDULED_EXCEPTION(isolate);
|
| if (!result.IsEmpty()) {
|
| @@ -11583,13 +11598,15 @@ MaybeObject* JSObject::GetPropertyWithInterceptor(
|
| v8::ToCData<v8::NamedPropertyGetter>(interceptor->getter());
|
| LOG(isolate,
|
| ApiNamedPropertyAccess("interceptor-named-get", *holder_handle, name));
|
| - CustomArguments args(isolate, interceptor->data(), receiver, this);
|
| - v8::AccessorInfo info(args.end());
|
| + PropertyCallbackArguments
|
| + args(isolate, interceptor->data(), receiver, this);
|
| + v8::AccessorInfo info = args.NewInfo();
|
| v8::Handle<v8::Value> result;
|
| {
|
| // Leaving JavaScript.
|
| VMState<EXTERNAL> state(isolate);
|
| - result = getter(v8::Utils::ToLocal(name_handle), info);
|
| + result = args.GetCallbackResult(
|
| + isolate, getter, getter(v8::Utils::ToLocal(name_handle), info));
|
| }
|
| RETURN_IF_SCHEDULED_EXCEPTION(isolate);
|
| if (!result.IsEmpty()) {
|
|
|