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

Unified Diff: src/lookup.cc

Issue 1193343002: Move SetFastDoubleElementsCapacity into GrowCapacityAndConvert (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.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 834870a454eabd85669d2e607210f3aa18ce9861..296d192083a76120b5e5a6697ae8822130f00495 100644
--- a/src/lookup.cc
+++ b/src/lookup.cc
@@ -121,26 +121,10 @@ void LookupIterator::PrepareForDataProperty(Handle<Object> value) {
JSObject::UpdateAllocationSite(holder, new_kind);
if (IsFastDoubleElementsKind(old_kind) !=
IsFastDoubleElementsKind(new_kind)) {
- Handle<FixedArrayBase> old_elements(holder->elements());
- int capacity = old_elements->length();
- Handle<FixedArrayBase> new_elements;
- if (IsFastDoubleElementsKind(new_kind)) {
- new_elements = factory()->NewFixedDoubleArray(capacity);
- } else {
- new_elements = factory()->NewFixedArray(capacity);
- }
-
+ uint32_t capacity = holder->elements()->length();
ElementsAccessor* accessor = ElementsAccessor::ForKind(new_kind);
- accessor->CopyElements(holder, new_elements, old_kind);
-
- JSObject::ValidateElements(holder);
- JSObject::SetMapAndElements(holder, holder_map_, new_elements);
-
- if (FLAG_trace_elements_transitions) {
- JSObject::PrintElementsTransition(
- stdout, holder, old_kind, old_elements, new_kind, new_elements);
- }
- // SetMapAndElements above migrated the object. No reloading of property
+ accessor->GrowCapacityAndConvert(holder, capacity);
+ // GrowCapacityAndConvert migrated the object. No reloading of property
// infomation is necessary for elements.
return;
} else if (FLAG_trace_elements_transitions) {
« no previous file with comments | « src/elements.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698