Commit 752c1239 authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

[runtime] Remove dependency on the backing store age in DeleteCommon

Currently the function normalizes only old sparse backing stores.
This patch removed the age check to decouple the heuristic from GC.

Change-Id: I9b7f787315b2b8facfa35358143173f7d207c8da
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2846897Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74156}
parent e1e1220a
......@@ -1904,12 +1904,10 @@ class FastElementsAccessor : public ElementsAccessorBase<Subclass, KindTraits> {
backing_store->set_the_hole(isolate, entry);
// TODO(verwaest): Move this out of elements.cc.
// If an old space backing store is larger than a certain size and
// If the backing store is larger than a certain size and
// has too few used values, normalize it.
const int kMinLengthForSparsenessCheck = 64;
if (backing_store->length() < kMinLengthForSparsenessCheck) return;
// TODO(ulan): Check if it works with young large objects.
if (ObjectInYoungGeneration(*backing_store)) return;
uint32_t length = 0;
if (obj->IsJSArray()) {
JSArray::cast(*obj).length().ToArrayLength(&length);
......
......@@ -775,7 +775,6 @@ static inline bool ShouldConvertToSlowElements(JSObject object,
if (index - capacity >= JSObject::kMaxGap) return true;
*new_capacity = JSObject::NewElementsCapacity(index + 1);
DCHECK_LT(index, *new_capacity);
// TODO(ulan): Check if it works with young large objects.
if (*new_capacity <= JSObject::kMaxUncheckedOldFastElementsLength ||
(*new_capacity <= JSObject::kMaxUncheckedFastElementsLength &&
ObjectInYoungGeneration(object))) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment