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

Unified Diff: src/lookup.cc

Issue 1717603002: [LookupIterator] Optimize the path that writes to fields. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lookup.cc
diff --git a/src/lookup.cc b/src/lookup.cc
index 1265d9056ea74f046584ebb21248a882c77bf9f0..38e5d1ad2b0a2dc6742aea89498b6d68f345c22f 100644
--- a/src/lookup.cc
+++ b/src/lookup.cc
@@ -517,18 +517,21 @@ void LookupIterator::WriteDataValue(Handle<Object> value) {
Handle<JSObject> object = Handle<JSObject>::cast(holder);
ElementsAccessor* accessor = object->GetElementsAccessor();
accessor->Set(object, number_, *value);
+ } else if (holder->HasFastProperties()) {
+ if (property_details_.type() == v8::internal::DATA) {
+ JSObject::cast(*holder)->WriteToField(descriptor_number(),
+ property_details_, *value);
+ } else {
+ DCHECK_EQ(v8::internal::DATA_CONSTANT, property_details_.type());
+ }
} else if (holder->IsJSGlobalObject()) {
Handle<GlobalDictionary> property_dictionary =
handle(JSObject::cast(*holder)->global_dictionary());
PropertyCell::UpdateCell(property_dictionary, dictionary_entry(), value,
property_details_);
- } else if (!holder->HasFastProperties()) {
+ } else {
NameDictionary* property_dictionary = holder->property_dictionary();
property_dictionary->ValueAtPut(dictionary_entry(), *value);
- } else if (property_details_.type() == v8::internal::DATA) {
- JSObject::cast(*holder)->WriteToField(descriptor_number(), *value);
- } else {
- DCHECK_EQ(v8::internal::DATA_CONSTANT, property_details_.type());
}
}
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698