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

Unified Diff: src/builtins.cc

Issue 203833005: Account for right object size when left trimming arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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/builtins.cc
diff --git a/src/builtins.cc b/src/builtins.cc
index 38e090e9bcfdbf3396f0e6220ce8d8748d29622a..f2610fe5e80c5f2c516b10a6a52400e4d376af9d 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -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(),
« 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