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

Unified Diff: src/elements.cc

Issue 1305353010: Remove LeftTrimFixedArray (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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 | src/heap/heap.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 32e6605ca2fbd04d07a80a387a825c6bec346482..c6d47d9a8df87c5640425bf27a9b529b98de2e12 100644
--- a/src/elements.cc
+++ b/src/elements.cc
@@ -1337,12 +1337,8 @@ class FastElementsAccessor
Handle<Object> result =
FastElementsAccessorSubclass::GetImpl(backing_store, 0);
Heap* heap = isolate->heap();
- if (heap->CanMoveObjectStart(*backing_store)) {
- receiver->set_elements(heap->LeftTrimFixedArray(*backing_store, 1));
- } else {
- FastElementsAccessorSubclass::MoveElements(heap, backing_store, 0, 1,
- new_length, 0, 0);
- }
+ FastElementsAccessorSubclass::MoveElements(heap, backing_store, 0, 1,
+ new_length, 0, 0);
FastElementsAccessorSubclass::SetLengthImpl(receiver, new_length,
backing_store);
@@ -1509,22 +1505,9 @@ class FastElementsAccessor
uint32_t len, uint32_t new_length) {
const int move_left_count = len - delete_count - start;
const int move_left_dst_index = start + add_count;
- const bool left_trim_array = heap->CanMoveObjectStart(*backing_store) &&
- (move_left_dst_index < move_left_count);
- if (left_trim_array) {
- const int delta = delete_count - add_count;
- // shift from before the insertion point to the right
- FastElementsAccessorSubclass::MoveElements(heap, backing_store, delta, 0,
- start, 0, 0);
- backing_store = handle(heap->LeftTrimFixedArray(*backing_store, delta));
- return true;
- } else {
- // No left-trim needed or possible (in this case we left-move and store
- // the hole)
- FastElementsAccessorSubclass::MoveElements(
- heap, backing_store, move_left_dst_index, start + delete_count,
- move_left_count, new_length, len);
- }
+ FastElementsAccessorSubclass::MoveElements(
+ heap, backing_store, move_left_dst_index, start + delete_count,
+ move_left_count, new_length, len);
return false;
}
« no previous file with comments | « no previous file | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698