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

Unified Diff: src/objects.cc

Issue 1600923002: [runtime] Stop cloning AccessorInfo, just rely on PropertyAttributes for readonly. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »
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 aa180cc57569bafb99106879683dd38673fc29c2..ed3f3822eb6ac3efcdac9c01350844b4c5f7a9e5 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -5204,13 +5204,6 @@ void JSObject::AddProperty(Handle<JSObject> object, Handle<Name> name,
}
-// static
-void AccessorInfo::ClearSetter(Handle<AccessorInfo> info) {
- Handle<Object> object = v8::FromCData(info->GetIsolate(), nullptr);
- info->set_setter(*object);
-}
-
-
// Reconfigures a property to a data property with attributes, even if it is not
// reconfigurable.
// Requires a LookupIterator that does not look at the prototype chain beyond
@@ -5279,15 +5272,7 @@ Maybe<bool> JSObject::DefineOwnPropertyIgnoreAttributes(
if (details.attributes() == attributes) return Just(true);
// Reconfigure the accessor if attributes mismatch.
- Handle<AccessorInfo> new_data = Accessors::CloneAccessor(
- it->isolate(), Handle<AccessorInfo>::cast(accessors));
- new_data->set_property_attributes(attributes);
- // By clearing the setter we don't have to introduce a lookup to
- // the setter, simply make it unavailable to reflect the
- // attributes.
- if (attributes & READ_ONLY) AccessorInfo::ClearSetter(new_data);
-
- it->TransitionToAccessorPair(new_data, attributes);
+ it->TransitionToAccessorPair(accessors, attributes);
} else {
it->ReconfigureDataProperty(value, attributes);
}
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698