Lines Matching refs:page
157 // evacuating a page, already swept pages will have enough free bytes to
230 Address free_start, Address free_end, Page* page, Space* space,
243 page->heap()->CreateFillerObjectAtBackground(
249 if (should_reduce_memory_) page->DiscardUnusedMemory(free_start, size);
255 Address free_start, Address free_end, Page* page, bool record_free_ranges,
265 RememberedSet<OLD_TO_NEW>::RemoveRange(page, free_start, free_end,
270 RememberedSet<OLD_TO_OLD>::RemoveRange(page, free_start, free_end,
273 DCHECK_NULL(page->slot_set<OLD_TO_OLD>());
278 RememberedSet<OLD_TO_SHARED>::RemoveRange(page, free_start, free_end,
283 static_cast<uint32_t>(free_start - page->address()),
284 static_cast<uint32_t>(free_end - page->address())));
291 Page* page, const TypedSlotSet::FreeRangesMap& free_ranges_map,
294 page->ClearInvalidTypedSlots<OLD_TO_NEW>(free_ranges_map);
299 page->AssertNoInvalidTypedSlots<OLD_TO_OLD>(free_ranges_map);
301 page->ClearInvalidTypedSlots<OLD_TO_SHARED>(free_ranges_map);
309 page->AssertNoInvalidTypedSlots<OLD_TO_NEW>(free_ranges_map);
310 DCHECK_NULL(page->typed_slot_set<OLD_TO_OLD>());
311 page->ClearInvalidTypedSlots<OLD_TO_SHARED>(free_ranges_map);
315 Page* page, size_t live_bytes, FreeListRebuildingMode free_list_mode) {
316 marking_state_->bitmap(page)->Clear();
318 marking_state_->SetLiveBytes(page, 0);
320 intptr_t freed_bytes = page->area_size() - live_bytes;
321 page->DecreaseAllocatedBytes(freed_bytes);
323 // Keep the old live bytes counter of the page until RefillFreeList, where
326 DCHECK_EQ(live_bytes, page->allocated_bytes());
340 // Phase 1: Prepare the page for sweeping.
386 // Iterate over the page using the live objects and free the memory before
436 // Phase 3: Post process the page.
464 Page* page = GetSweepingPageSafe(identity);
465 if (page == nullptr) return true;
468 DCHECK_NULL((page->typed_slot_set<OLD_TO_NEW>()));
469 DCHECK_NULL((page->typed_slot_set<OLD_TO_OLD>()));
470 ParallelSweepPage(page, identity, SweepingMode::kLazyOrConcurrent);
479 if (Page* page = GetSweepingPageSafe(identity)) {
480 ParallelSweepPage(page, identity, SweepingMode::kLazyOrConcurrent);
492 Page* page = nullptr;
493 while ((page = GetSweepingPageSafe(identity)) != nullptr) {
494 int freed = ParallelSweepPage(page, identity, sweeping_mode);
496 if (page->IsFlagSet(Page::NEVER_ALLOCATE_ON_PAGE)) {
497 // Free list of a never-allocate page will be dropped later on.
509 int Sweeper::ParallelSweepPage(Page* page, AllocationSpace identity,
514 if (page->SweepingDone()) return 0;
518 base::MutexGuard guard(page->mutex());
519 DCHECK(!page->SweepingDone());
520 // If the page is a code page, the CodePageMemoryModificationScope changes
521 // the page protection mode from rx -> rw while sweeping.
522 CodePageMemoryModificationScope code_page_scope(page);
525 page->concurrent_sweeping_state());
526 page->set_concurrent_sweeping_state(
530 max_freed = RawSweep(page, REBUILD_FREE_LIST, free_space_mode,
532 DCHECK(page->SweepingDone());
537 swept_list_[GetSweepSpaceIndex(identity)].push_back(page);
543 void Sweeper::EnsurePageIsSwept(Page* page) {
544 if (!sweeping_in_progress() || page->SweepingDone()) return;
545 AllocationSpace space = page->owner_identity();
548 if (TryRemoveSweepingPageSafe(space, page)) {
550 ParallelSweepPage(page, space, SweepingMode::kLazyOrConcurrent);
552 // Some sweeper task already took ownership of that page, wait until
555 while (!page->SweepingDone()) {
560 DCHECK(page->InNewSpace());
564 CHECK(page->SweepingDone());
567 bool Sweeper::TryRemoveSweepingPageSafe(AllocationSpace space, Page* page) {
573 std::find(sweeping_list.begin(), sweeping_list.end(), page);
590 void Sweeper::AddPage(AllocationSpace space, Page* page,
596 PrepareToBeSweptPage(space, page);
599 // happened when the page was initially added, so it is skipped here.
603 page->concurrent_sweeping_state());
604 sweeping_list_[GetSweepSpaceIndex(space)].push_back(page);
607 void Sweeper::PrepareToBeSweptPage(AllocationSpace space, Page* page) {
609 DCHECK_GE(page->area_size(),
610 static_cast<size_t>(marking_state_->live_bytes(page)));
612 page->concurrent_sweeping_state());
613 page->ForAllFreeListCategories([page](FreeListCategory* category) {
614 DCHECK(!category->is_linked(page->owner()->free_list()));
617 page->set_concurrent_sweeping_state(Page::ConcurrentSweepingState::kPending);
619 marking_state_->live_bytes(page), page);
626 Page* page = nullptr;
628 page = sweeping_list_[space_index].back();
631 return page;
645 for (Page* page : iterability_list_) {
646 MakeIterable(page);
670 for (Page* page : sweeper_->iterability_list_) {
671 sweeper_->MakeIterable(page);
695 void Sweeper::AddPageForIterability(Page* page) {
699 DCHECK(IsValidIterabilitySpace(page->owner_identity()));
701 page->concurrent_sweeping_state());
703 iterability_list_.push_back(page);
704 page->set_concurrent_sweeping_state(Page::ConcurrentSweepingState::kPending);
707 void Sweeper::MakeIterable(Page* page) {
708 base::MutexGuard guard(page->mutex());
709 DCHECK(IsValidIterabilitySpace(page->owner_identity()));
712 RawSweep(page, IGNORE_FREE_LIST, free_space_mode,