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

Unified Diff: src/runtime/runtime-array.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/objects.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-array.cc
diff --git a/src/runtime/runtime-array.cc b/src/runtime/runtime-array.cc
index b03ac2467ec1a40450355e4be5bf777b81c4d4db..eb2843469ad370f055dbe1e47dc736cbbba1b846 100644
--- a/src/runtime/runtime-array.cc
+++ b/src/runtime/runtime-array.cc
@@ -1258,16 +1258,7 @@ RUNTIME_FUNCTION(Runtime_GrowArrayElements) {
}
uint32_t new_capacity = JSObject::NewElementsCapacity(index + 1);
- ElementsKind kind = object->GetElementsKind();
- if (IsFastDoubleElementsKind(kind)) {
- JSObject::SetFastDoubleElementsCapacity(object, new_capacity);
- } else {
- JSObject::SetFastElementsCapacitySmiMode set_capacity_mode =
- object->HasFastSmiElements() ? JSObject::kAllowSmiElements
- : JSObject::kDontAllowSmiElements;
- JSObject::SetFastElementsCapacity(object, new_capacity,
- set_capacity_mode);
- }
+ object->GetElementsAccessor()->GrowCapacityAndConvert(object, new_capacity);
}
// On success, return the fixed array elements.
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698