[heap] Do not select never allocate pages as evacuation candidates

TBR=ulan@chromium.org

Change-Id: I793d99ec5b82d2f2444a20db5f0eb4e08bea4da4
Reviewed-on: https://chromium-review.googlesource.com/645308
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47737}
This commit is contained in:
Michael Lippautz 2017-08-31 12:02:25 +02:00 committed by Commit Bot
parent 47efa29a7e
commit 4e4def64d4
2 changed files with 4 additions and 1 deletions

View File

@ -834,7 +834,9 @@ void MarkCompactCollector::CollectEvacuationCandidates(PagedSpace* space) {
? nullptr
: Page::FromAllocationAreaAddress(space->top());
for (Page* p : *space) {
if (p->NeverEvacuate() || p == owner_of_linear_allocation_area) continue;
if (p->NeverEvacuate() || (p == owner_of_linear_allocation_area) ||
!p->CanAllocate())
continue;
// Invariant: Evacuation candidates are just created when marking is
// started. This means that sweeping has finished. Furthermore, at the end
// of a GC all evacuation candidates are cleared and their slot buffers are

View File

@ -201,6 +201,7 @@ void Page::MarkNeverAllocateForTesting() {
DCHECK(this->owner()->identity() != NEW_SPACE);
DCHECK(!IsFlagSet(NEVER_ALLOCATE_ON_PAGE));
SetFlag(NEVER_ALLOCATE_ON_PAGE);
SetFlag(NEVER_EVACUATE);
reinterpret_cast<PagedSpace*>(owner())->free_list()->EvictFreeListItems(this);
}