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

Unified Diff: src/objects.cc

Issue 1702443002: [runtime] Minor tweaks to LookupIterator for performance (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
« src/lookup.cc ('K') | « src/lookup.cc ('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 89bc3c91c941c765ff346f068f93ce38a9044970..c3399992edc7e64cb298c4fe5b83240ae93cc211 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -4493,8 +4493,7 @@ Maybe<bool> Object::AddDataProperty(LookupIterator* it, Handle<Object> value,
Isolate* isolate = it->isolate();
- if (!receiver->map()->is_extensible() &&
- (it->IsElement() || !isolate->IsInternallyUsedPropertyName(it->name()))) {
+ if (it->ExtendingNonExtensible(receiver)) {
RETURN_FAILURE(
isolate, should_throw,
NewTypeError(MessageTemplate::kObjectNotExtensible, it->GetName()));
@@ -4527,9 +4526,10 @@ Maybe<bool> Object::AddDataProperty(LookupIterator* it, Handle<Object> value,
} else {
// Migrate to the most up-to-date map that will be able to store |value|
// under it->name() with |attributes|.
- it->PrepareTransitionToDataProperty(value, attributes, store_mode);
+ it->PrepareTransitionToDataProperty(receiver, value, attributes,
+ store_mode);
DCHECK_EQ(LookupIterator::TRANSITION, it->state());
- it->ApplyTransitionToDataProperty();
+ it->ApplyTransitionToDataProperty(receiver);
// TODO(verwaest): Encapsulate dictionary handling better.
if (receiver->map()->is_dictionary_map()) {
@@ -9942,13 +9942,11 @@ Handle<Map> Map::PrepareForDataProperty(Handle<Map> map, int descriptor,
// Migrate to the newest map before storing the property.
map = Update(map);
- Handle<DescriptorArray> descriptors(map->instance_descriptors());
-
- if (descriptors->CanHoldValue(descriptor, *value)) return map;
+ if (map->instance_descriptors()->CanHoldValue(descriptor, *value)) return map;
Isolate* isolate = map->GetIsolate();
PropertyAttributes attributes =
- descriptors->GetDetails(descriptor).attributes();
+ map->instance_descriptors()->GetDetails(descriptor).attributes();
Representation representation = value->OptimalRepresentation();
Handle<FieldType> type = value->OptimalType(isolate, representation);
« src/lookup.cc ('K') | « src/lookup.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698