Commit 42de2044 authored by hpayer@chromium.org's avatar hpayer@chromium.org

Account for right object size when left trimming arrays.

BUG=
R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/203833005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20063 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 0bc684a7
......@@ -268,11 +268,12 @@ static FixedArrayBase* LeftTrimFixedArray(Heap* heap,
// Maintain marking consistency for HeapObjectIterator and
// IncrementalMarking.
int size_delta = to_trim * entry_size;
heap->marking()->TransferMark(elms->address(), elms->address() + size_delta);
heap->AdjustLiveBytes(elms->address(), -size_delta, Heap::FROM_MUTATOR);
Address new_start = elms->address() + size_delta;
heap->marking()->TransferMark(elms->address(), new_start);
heap->AdjustLiveBytes(new_start, -size_delta, Heap::FROM_MUTATOR);
FixedArrayBase* new_elms = FixedArrayBase::cast(HeapObject::FromAddress(
elms->address() + size_delta));
FixedArrayBase* new_elms =
FixedArrayBase::cast(HeapObject::FromAddress(new_start));
HeapProfiler* profiler = heap->isolate()->heap_profiler();
if (profiler->is_tracking_object_moves()) {
profiler->ObjectMoveEvent(elms->address(),
......
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