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

Unified Diff: src/elements.cc

Issue 2872173003: [runtime] do not left-trim short arrays (Closed)
Patch Set: Created 3 years, 7 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 | « no previous file | no next file » | 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 dd190b9966ac25cad4fe61644e2be39b26c58f55..448d56bfae48ae65e17b48006e7054a048613798 100644
--- a/src/elements.cc
+++ b/src/elements.cc
@@ -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));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698