From 92a7012b8b22227167eb1212c9d1592cf2e37510 Mon Sep 17 00:00:00 2001 From: mlippautz Date: Tue, 29 Sep 2015 06:07:24 -0700 Subject: [PATCH] [heap] Remove NewSpace::set_top and the corresponding hack - Remove the hack the resets the new space top pointer from SeqString::Truncate. - Remove NewSpace::set_top completely as there are no callers (and there should be no!) R=hpayer@chromium.org BUG=chromium:536163 LOG=N Review URL: https://codereview.chromium.org/1376753002 Cr-Commit-Position: refs/heads/master@{#31004} --- src/heap/incremental-marking.cc | 3 +-- src/heap/spaces.h | 5 ----- src/objects.cc | 13 +++---------- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/src/heap/incremental-marking.cc b/src/heap/incremental-marking.cc index 51b91ba..39ee846 100644 --- a/src/heap/incremental-marking.cc +++ b/src/heap/incremental-marking.cc @@ -901,8 +901,7 @@ intptr_t IncrementalMarking::Step(intptr_t allocated_bytes, CompletionAction action, ForceMarkingAction marking, ForceCompletionAction completion) { - // Temporarily removed for crbug.com/536163 - // DCHECK(allocated_bytes >= 0); + DCHECK(allocated_bytes >= 0); if (heap_->gc_state() != Heap::NOT_IN_GC || !FLAG_incremental_marking || (state_ != SWEEPING && state_ != MARKING)) { diff --git a/src/heap/spaces.h b/src/heap/spaces.h index 2cea066..2223808 100644 --- a/src/heap/spaces.h +++ b/src/heap/spaces.h @@ -2550,11 +2550,6 @@ class NewSpace : public Space { return allocation_info_.top(); } - void set_top(Address top) { - DCHECK(to_space_.current_page()->ContainsLimit(top)); - allocation_info_.set_top(top); - } - // Return the address of the allocation pointer limit in the active semispace. Address limit() { DCHECK(to_space_.current_page()->ContainsLimit(allocation_info_.limit())); diff --git a/src/objects.cc b/src/objects.cc index b6c40d6..0838303 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -9928,16 +9928,9 @@ Handle SeqString::Truncate(Handle string, int new_length) { DCHECK_OBJECT_ALIGNED(start_of_string + new_size); Heap* heap = string->GetHeap(); - NewSpace* newspace = heap->new_space(); - if (newspace->Contains(start_of_string) && - newspace->top() == start_of_string + old_size) { - // Last allocated object in new space. Simply lower allocation top. - newspace->set_top(start_of_string + new_size); - } else { - // Sizes are pointer size aligned, so that we can use filler objects - // that are a multiple of pointer size. - heap->CreateFillerObjectAt(start_of_string + new_size, delta); - } + // Sizes are pointer size aligned, so that we can use filler objects + // that are a multiple of pointer size. + heap->CreateFillerObjectAt(start_of_string + new_size, delta); heap->AdjustLiveBytes(*string, -delta, Heap::CONCURRENT_TO_SWEEPER); // We are storing the new length using release store after creating a filler -- 2.7.4