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

Unified Diff: src/objects.cc

Issue 791243002: Stop sending Object.observe notifications for API accessor properties (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Restore most of v8natives Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/v8natives.js » ('j') | src/v8natives.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 01d313a9237faa329217f5fb986b1ae28e329346..a75fb4753cef8d8d79cf4283509655ad58ee0555 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -3997,20 +3997,11 @@ MaybeHandle<Object> JSObject::SetOwnPropertyIgnoreAttributes(
case LookupIterator::ACCESSOR: {
PropertyDetails details = it.property_details();
- Handle<Object> old_value = it.isolate()->factory()->the_hole_value();
// Ensure the context isn't changed after calling into accessors.
AssertNoContextChange ncc(it.isolate());
Handle<Object> accessors = it.GetAccessors();
- if (is_observed && accessors->IsAccessorInfo()) {
- ASSIGN_RETURN_ON_EXCEPTION(
- it.isolate(), old_value,
- GetPropertyWithAccessor(it.GetReceiver(), it.name(),
- it.GetHolder<JSObject>(), accessors),
- Object);
- }
-
// Special handling for ExecutableAccessorInfo, which behaves like a
// data property.
if (handling == DONT_FORCE_FIELD &&
@@ -4025,21 +4016,6 @@ MaybeHandle<Object> JSObject::SetOwnPropertyIgnoreAttributes(
DCHECK(result->SameValue(*value));
if (details.attributes() == attributes) {
- // Regular property update if the attributes match.
- if (is_observed && !old_value->SameValue(*value)) {
- // If we are setting the prototype of a function and are
- // observed, don't send change records because the prototype
- // handles that itself.
- if (!object->IsJSFunction() ||
- !Name::Equals(it.isolate()->factory()->prototype_string(),
- name) ||
- !Handle<JSFunction>::cast(object)->should_have_prototype()) {
- RETURN_ON_EXCEPTION(
- it.isolate(),
- EnqueueChangeRecord(object, "update", name, old_value),
- Object);
- }
- }
return value;
}
@@ -4053,12 +4029,10 @@ MaybeHandle<Object> JSObject::SetOwnPropertyIgnoreAttributes(
if (attributes & READ_ONLY) new_data->clear_setter();
SetPropertyCallback(object, name, new_data, attributes);
if (is_observed) {
- if (old_value->SameValue(*value)) {
- old_value = it.isolate()->factory()->the_hole_value();
- }
RETURN_ON_EXCEPTION(
it.isolate(),
- EnqueueChangeRecord(object, "reconfigure", name, old_value),
+ EnqueueChangeRecord(object, "reconfigure", name,
+ it.isolate()->factory()->the_hole_value()),
Object);
}
return value;
@@ -4069,12 +4043,10 @@ MaybeHandle<Object> JSObject::SetOwnPropertyIgnoreAttributes(
it.WriteDataValue(value);
if (is_observed) {
- if (old_value->SameValue(*value)) {
- old_value = it.isolate()->factory()->the_hole_value();
- }
RETURN_ON_EXCEPTION(
it.isolate(),
- EnqueueChangeRecord(object, "reconfigure", name, old_value),
+ EnqueueChangeRecord(object, "reconfigure", name,
+ it.isolate()->factory()->the_hole_value()),
Object);
}
« no previous file with comments | « no previous file | src/v8natives.js » ('j') | src/v8natives.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698