Commit 8fba2d4a authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[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/809145Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49878}
parent b4470ea4
...@@ -469,6 +469,8 @@ void Sweeper::PrepareToBeSweptPage(AllocationSpace space, Page* page) { ...@@ -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) { ...@@ -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);
......
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