Commit 92a7012b authored by mlippautz's avatar mlippautz Committed by Commit bot

[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}
parent 134180d4
......@@ -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)) {
......
......@@ -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()));
......
......@@ -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
......
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