Commit 936b3d8d authored by tebbi's avatar tebbi Committed by Commit bot

[runtime] do not left-trim short arrays

BUG=v8:6380

Review-Url: https://codereview.chromium.org/2872173003
Cr-Commit-Position: refs/heads/master@{#45228}
parent 8f89e286
......@@ -2150,7 +2150,8 @@ class FastElementsAccessor : public ElementsAccessorBase<Subclass, KindTraits> {
int hole_end) {
Heap* heap = isolate->heap();
Handle<BackingStore> dst_elms = Handle<BackingStore>::cast(backing_store);
if (heap->CanMoveObjectStart(*dst_elms) && dst_index == 0) {
if (heap->CanMoveObjectStart(*dst_elms) && dst_index == 0 &&
len > JSArray::kMaxCopyElements) {
// Update all the copies of this backing_store handle.
*dst_elms.location() =
BackingStore::cast(heap->LeftTrimFixedArray(*dst_elms, src_index));
......
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