Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index e527fc665f2debd2984680714d3e65d23e86953f..a503b2ed763ff66753293df81eeb81c74d69fc03 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -2819,10 +2819,8 @@ Handle<Object> JSObject::SetPropertyWithCallback(Handle<JSObject> object, |
Handle<Object> setter(AccessorPair::cast(*structure)->setter(), isolate); |
if (setter->IsSpecFunction()) { |
// TODO(rossberg): nicer would be to cast to some JSCallable here... |
- CALL_HEAP_FUNCTION(isolate, |
- object->SetPropertyWithDefinedSetter( |
- JSReceiver::cast(*setter), *value), |
- Object); |
+ return SetPropertyWithDefinedSetter( |
+ object, Handle<JSReceiver>::cast(setter), value); |
} else { |
if (strict_mode == kNonStrictMode) { |
return value; |
@@ -2846,28 +2844,28 @@ Handle<Object> JSObject::SetPropertyWithCallback(Handle<JSObject> object, |
} |
-MaybeObject* JSReceiver::SetPropertyWithDefinedSetter(JSReceiver* setter, |
- Object* value) { |
- Isolate* isolate = GetIsolate(); |
- Handle<Object> value_handle(value, isolate); |
- Handle<JSReceiver> fun(setter, isolate); |
- Handle<JSReceiver> self(this, isolate); |
+Handle<Object> JSReceiver::SetPropertyWithDefinedSetter( |
+ Handle<JSReceiver> object, |
+ Handle<JSReceiver> setter, |
+ Handle<Object> value) { |
+ Isolate* isolate = object->GetIsolate(); |
+ |
#ifdef ENABLE_DEBUGGER_SUPPORT |
Debug* debug = isolate->debug(); |
// Handle stepping into a setter if step into is active. |
// TODO(rossberg): should this apply to getters that are function proxies? |
- if (debug->StepInActive() && fun->IsJSFunction()) { |
+ if (debug->StepInActive() && setter->IsJSFunction()) { |
debug->HandleStepIn( |
- Handle<JSFunction>::cast(fun), Handle<Object>::null(), 0, false); |
+ Handle<JSFunction>::cast(setter), Handle<Object>::null(), 0, false); |
} |
#endif |
bool has_pending_exception; |
- Handle<Object> argv[] = { value_handle }; |
+ Handle<Object> argv[] = { value }; |
Execution::Call( |
- isolate, fun, self, ARRAY_SIZE(argv), argv, &has_pending_exception); |
+ isolate, setter, object, ARRAY_SIZE(argv), argv, &has_pending_exception); |
// Check for pending exception and return the result. |
- if (has_pending_exception) return Failure::Exception(); |
- return *value_handle; |
+ if (has_pending_exception) return Handle<Object>(); |
+ return value; |
} |
@@ -3540,10 +3538,8 @@ Handle<Object> JSProxy::SetPropertyViaPrototypesWithHandler( |
ASSERT(!isolate->has_pending_exception()); |
if (!setter->IsUndefined()) { |
// TODO(rossberg): nicer would be to cast to some JSCallable here... |
- CALL_HEAP_FUNCTION(isolate, |
- receiver->SetPropertyWithDefinedSetter( |
- JSReceiver::cast(*setter), *value), |
- Object); |
+ return SetPropertyWithDefinedSetter( |
+ receiver, Handle<JSReceiver>::cast(setter), value); |
} |
if (strict_mode == kNonStrictMode) return value; |
@@ -11716,10 +11712,8 @@ Handle<Object> JSObject::SetElementWithCallback(Handle<JSObject> object, |
Handle<Object> setter(AccessorPair::cast(*structure)->setter(), isolate); |
if (setter->IsSpecFunction()) { |
// TODO(rossberg): nicer would be to cast to some JSCallable here... |
- CALL_HEAP_FUNCTION(isolate, |
- object->SetPropertyWithDefinedSetter( |
- JSReceiver::cast(*setter), *value), |
- Object); |
+ return SetPropertyWithDefinedSetter( |
+ object, Handle<JSReceiver>::cast(setter), value); |
} else { |
if (strict_mode == kNonStrictMode) { |
return value; |