Revision: 20063
Author:   [email protected]
Date:     Wed Mar 19 11:37:56 2014 UTC
Log:      Account for right object size when left trimming arrays.

BUG=
[email protected]

Review URL: https://codereview.chromium.org/203833005
http://code.google.com/p/v8/source/detail?r=20063

Modified:
 /branches/bleeding_edge/src/builtins.cc

=======================================
--- /branches/bleeding_edge/src/builtins.cc     Wed Mar 19 11:31:43 2014 UTC
+++ /branches/bleeding_edge/src/builtins.cc     Wed Mar 19 11:37:56 2014 UTC
@@ -268,11 +268,12 @@
   // 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(),

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to