[heap] Remove NewSpace::set_top and the corresponding hack
authormlippautz <mlippautz@chromium.org>
Tue, 29 Sep 2015 13:07:24 +0000 (06:07 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 29 Sep 2015 13:07:39 +0000 (13:07 +0000)
- 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
src/heap/spaces.h
src/objects.cc

index 51b91ba..39ee846 100644 (file)
@@ -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)) {
index 2cea066..2223808 100644 (file)
@@ -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()));
index b6c40d6..0838303 100644 (file)
@@ -9928,16 +9928,9 @@ Handle<String> SeqString::Truncate(Handle<SeqString> 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