[heap] Avoid checking whether FreeListCategories are linked in NewSpace

The space does not have a FreeList and the cast to PagedSpace is UB.

Bug: chromium:792105
Change-Id: If566374ab87374302a209a9ba4a15ce7c198a4e0
Reviewed-on: https://chromium-review.googlesource.com/809145
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49878}
This commit is contained in:
Michael Lippautz 2017-12-05 17:57:15 +01:00 committed by Commit Bot
parent b4470ea4cf
commit 8fba2d4a25

View File

@ -469,6 +469,8 @@ void Sweeper::PrepareToBeSweptPage(AllocationSpace space, Page* page) {
DCHECK_GE(page->area_size(), DCHECK_GE(page->area_size(),
static_cast<size_t>(marking_state_->live_bytes(page))); static_cast<size_t>(marking_state_->live_bytes(page)));
DCHECK_EQ(Page::kSweepingDone, page->concurrent_sweeping_state().Value()); DCHECK_EQ(Page::kSweepingDone, page->concurrent_sweeping_state().Value());
page->ForAllFreeListCategories(
[](FreeListCategory* category) { DCHECK(!category->is_linked()); });
page->concurrent_sweeping_state().SetValue(Page::kSweepingPending); page->concurrent_sweeping_state().SetValue(Page::kSweepingPending);
heap_->paged_space(space)->IncreaseAllocatedBytes( heap_->paged_space(space)->IncreaseAllocatedBytes(
marking_state_->live_bytes(page), page); marking_state_->live_bytes(page), page);
@ -558,8 +560,6 @@ void Sweeper::AddPageForIterability(Page* page) {
DCHECK(!iterability_task_started_); DCHECK(!iterability_task_started_);
DCHECK(IsValidIterabilitySpace(page->owner()->identity())); DCHECK(IsValidIterabilitySpace(page->owner()->identity()));
DCHECK_EQ(Page::kSweepingDone, page->concurrent_sweeping_state().Value()); DCHECK_EQ(Page::kSweepingDone, page->concurrent_sweeping_state().Value());
page->ForAllFreeListCategories(
[](FreeListCategory* category) { DCHECK(!category->is_linked()); });
iterability_list_.push_back(page); iterability_list_.push_back(page);
page->concurrent_sweeping_state().SetValue(Page::kSweepingPending); page->concurrent_sweeping_state().SetValue(Page::kSweepingPending);