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

Unified Diff: src/elements.cc

Issue 1194943004: Get rid of JSArray::Expand and friends (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.h ('k') | src/json-stringifier.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/elements.cc
diff --git a/src/elements.cc b/src/elements.cc
index f1cddc45fd7b8104b073ec1d616ec10669608ad2..6d462fa9a6fc39ac4a67fe0ce2143397881b99b0 100644
--- a/src/elements.cc
+++ b/src/elements.cc
@@ -644,16 +644,7 @@ class ElementsAccessorBase : public ElementsAccessor {
static void SetLengthImpl(Handle<JSArray> array, uint32_t length,
Handle<FixedArrayBase> backing_store);
- virtual void SetCapacityAndLength(Handle<JSArray> array, int capacity,
- int length) final {
- ElementsAccessorSubclass::
- SetFastElementsCapacityAndLength(array, capacity, length);
- }
-
- static void SetFastElementsCapacityAndLength(
- Handle<JSObject> obj,
- int capacity,
- int length) {
+ static void GrowCapacityAndConvert(Handle<JSObject> obj, int capacity) {
UNIMPLEMENTED();
}
@@ -1021,7 +1012,7 @@ class FastSmiOrObjectElementsAccessor
break;
case SLOPPY_ARGUMENTS_ELEMENTS: {
// TODO(verwaest): This is a temporary hack to support extending
- // SLOPPY_ARGUMENTS_ELEMENTS in SetFastElementsCapacityAndLength.
+ // SLOPPY_ARGUMENTS_ELEMENTS in GrowCapacityAndConvert.
// This case should be UNREACHABLE().
FixedArray* parameter_map = FixedArray::cast(from);
FixedArrayBase* arguments = FixedArrayBase::cast(parameter_map->get(1));
@@ -1040,16 +1031,12 @@ class FastSmiOrObjectElementsAccessor
}
- static void SetFastElementsCapacityAndLength(
- Handle<JSObject> obj,
- uint32_t capacity,
- uint32_t length) {
+ static void GrowCapacityAndConvert(Handle<JSObject> obj, uint32_t capacity) {
JSObject::SetFastElementsCapacitySmiMode set_capacity_mode =
obj->HasFastSmiElements()
? JSObject::kAllowSmiElements
: JSObject::kDontAllowSmiElements;
- JSObject::SetFastElementsCapacityAndLength(
- obj, capacity, length, set_capacity_mode);
+ JSObject::SetFastElementsCapacity(obj, capacity, set_capacity_mode);
}
};
@@ -1111,10 +1098,8 @@ class FastDoubleElementsAccessor
: FastElementsAccessor<FastElementsAccessorSubclass,
KindTraits>(name) {}
- static void SetFastElementsCapacityAndLength(Handle<JSObject> obj,
- uint32_t capacity,
- uint32_t length) {
- JSObject::SetFastDoubleElementsCapacityAndLength(obj, capacity, length);
+ static void GrowCapacityAndConvert(Handle<JSObject> obj, uint32_t capacity) {
+ JSObject::SetFastDoubleElementsCapacity(obj, capacity);
}
protected:
@@ -1679,8 +1664,7 @@ void ElementsAccessorBase<ElementsAccessorSubclass, ElementsKindTraits>::
} else {
// Check whether the backing store should be expanded.
capacity = Max(length, JSObject::NewElementsCapacity(capacity));
- ElementsAccessorSubclass::SetFastElementsCapacityAndLength(array, capacity,
- length);
+ ElementsAccessorSubclass::GrowCapacityAndConvert(array, capacity);
}
array->set_length(Smi::FromInt(length));
« no previous file with comments | « src/elements.h ('k') | src/json-stringifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698