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

Unified Diff: src/lookup.cc

Issue 1207613005: Move reconfiguration into the elements accessor (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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/elements.cc ('k') | src/objects.cc » ('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 296d192083a76120b5e5a6697ae8822130f00495..716622b475de66d098dfa587ad8b467f47d01f6d 100644
--- a/src/lookup.cc
+++ b/src/lookup.cc
@@ -156,19 +156,12 @@ void LookupIterator::ReconfigureDataProperty(Handle<Object> value,
DCHECK(HolderIsReceiverOrHiddenPrototype());
Handle<JSObject> holder = GetHolder<JSObject>();
if (IsElement()) {
- // TODO(verwaest): Clean up.
- DCHECK(holder->HasFastElements() || holder->HasDictionaryElements() ||
- holder->HasSloppyArgumentsElements());
+ DCHECK(!holder->HasExternalArrayElements());
+ DCHECK(!holder->HasFixedTypedArrayElements());
DCHECK(attributes != NONE || !holder->HasFastElements());
- Handle<SeededNumberDictionary> d = JSObject::NormalizeElements(holder);
- // TODO(verwaest): Move this into NormalizeElements.
- d->set_requires_slow_elements();
- if (holder->HasDictionaryElements()) {
- JSObject::SetDictionaryElement(holder, index(), value, attributes);
- } else {
- JSObject::SetDictionaryArgumentsElement(holder, index(), value,
- attributes);
- }
+ Handle<FixedArrayBase> elements(holder->elements());
+ holder->GetElementsAccessor()->Reconfigure(holder, elements, number_, value,
+ attributes);
} else if (holder_map_->is_dictionary_map()) {
PropertyDetails details(attributes, v8::internal::DATA, 0,
PropertyCellType::kMutable);
« no previous file with comments | « src/elements.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698