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

Unified Diff: src/lookup.cc

Issue 1703513002: [runtime] More LookupIterator / Transition related performance tweaks (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase 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 | « src/field-type.cc ('k') | 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 6d5a60205f1a50e0d6d81369a65b33528f9ea326..acbd82b0584cb6910fea6212fe8f94e901e0a4bd 100644
--- a/src/lookup.cc
+++ b/src/lookup.cc
@@ -181,8 +181,9 @@ void LookupIterator::PrepareForDataProperty(Handle<Object> value) {
if (kind == to) return;
+ } else if (holder_map_->is_dictionary_map()) {
+ return;
} else {
- if (holder_map_->is_dictionary_map()) return;
holder_map_ =
Map::PrepareForDataProperty(holder_map_, descriptor_number(), value);
@@ -247,19 +248,30 @@ void LookupIterator::PrepareTransitionToDataProperty(
DCHECK_NE(INTEGER_INDEXED_EXOTIC, state_);
DCHECK(state_ == NOT_FOUND || !HolderIsReceiverOrHiddenPrototype());
- auto transition = Map::TransitionToDataProperty(
- handle(receiver->map(), isolate_), name_, value, attributes, store_mode);
+ Handle<Map> map(receiver->map(), isolate_);
+
+ // Dictionary maps can always have additional data properties.
+ if (map->is_dictionary_map()) {
+ state_ = TRANSITION;
+ if (map->IsJSGlobalObjectMap()) {
+ // Install a property cell.
+ InternalizeName();
+ auto cell = JSGlobalObject::EnsurePropertyCell(
+ Handle<JSGlobalObject>::cast(receiver), name());
+ DCHECK(cell->value()->IsTheHole());
+ transition_ = cell;
+ } else {
+ transition_ = map;
+ }
+ return;
+ }
+
+ Handle<Map> transition =
+ Map::TransitionToDataProperty(map, name_, value, attributes, store_mode);
state_ = TRANSITION;
transition_ = transition;
- if (receiver->IsJSGlobalObject()) {
- // Install a property cell.
- InternalizeName();
- auto cell = JSGlobalObject::EnsurePropertyCell(
- Handle<JSGlobalObject>::cast(receiver), name());
- DCHECK(cell->value()->IsTheHole());
- transition_ = cell;
- } else if (!transition->is_dictionary_map()) {
+ if (!transition->is_dictionary_map()) {
property_details_ = transition->GetLastDescriptorDetails();
has_property_ = true;
}
« no previous file with comments | « src/field-type.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698