Home | History | Annotate | Download | only in heap

Lines Matching refs:page

22   // You can't actually iterate over the anchor page.  It is not a real page,
23 // just an anchor for the double linked page list. Initialize as if we have
24 // reached the end of the anchor page, then the first iteration will move on
25 // to the first page.
32 // You can't actually iterate over the anchor page. It is not a real page,
33 // just an anchor for the double linked page list. Initialize the current
35 // to the first page.
40 HeapObjectIterator::HeapObjectIterator(Page* page,
42 Space* owner = page->owner();
43 DCHECK(owner == page->heap()->old_pointer_space() ||
44 owner == page->heap()->old_data_space() ||
45 owner == page->heap()->map_space() ||
46 owner == page->heap()->cell_space() ||
47 owner == page->heap()->property_cell_space() ||
48 owner == page->heap()->code_space());
49 Initialize(reinterpret_cast<PagedSpace*>(owner), page->area_start(),
50 page->area_end(), kOnePageOnly, size_func);
51 DCHECK(page->WasSwept() || page->SweepingCompleted());
66 // We have hit the end of the page and should advance to the next block of
67 // objects. This happens at the end of the page.
71 Page* cur_page;
75 cur_page = Page::FromAddress(cur_addr_ - 1);
200 if (aligned_requested >= (current.size - Page::kPageSize)) {
263 capacity_ = RoundUp(capacity, Page::kPageSize);
264 capacity_executable_ = RoundUp(capacity_executable, Page::kPageSize);
391 void Page::InitializeAsAnchor(PagedSpace* owner) {
401 Address area_end = start + Page::kPageSize;
404 MemoryChunk::Initialize(heap, start, Page::kPageSize, area_start,
414 NewSpacePage* page = static_cast<NewSpacePage*>(chunk);
415 heap->incremental_marking()->SetNewSpacePageFlags(page);
416 return page;
424 // Flags marks this invalid page as not being in new-space.
573 // +----------------------------+<- aligned at OS page boundary
575 // +----------------------------+<- aligned at OS page boundary
586 // +----------------------------+<- aligned at OS page boundary
646 ZapBlock(base, Page::kObjectStartOffset + commit_area_size);
649 area_start = base + Page::kObjectStartOffset;
671 void Page::ResetFreeListStatistics() {
680 Page* MemoryAllocator::AllocatePage(intptr_t size, PagedSpace* owner,
686 return Page::Initialize(isolate_->heap(), chunk, executable, owner);
809 // We are guarding code pages: the first OS page after the header
811 return RoundUp(Page::kObjectStartOffset, base::OS::CommitPageSize());
821 // We are guarding code pages: the first OS page after the header
828 // We are guarding code pages: the last OS page will be protected as
830 return Page::kPageSize - static_cast<int>(base::OS::CommitPageSize());
837 // Commit page header (not executable).
842 // Create guard page after the header.
847 // Commit page body (executable).
853 // Create guard page before the end.
870 if (!chunk->InNewSpace() && !static_cast<Page*>(chunk)->WasSwept()) {
890 area_size_ = Page::kPageSize - Page::kObjectStartOffset;
893 (RoundDown(max_capacity, Page::kPageSize) / Page::kPageSize) * AreaSize();
938 Page* p = Page::FromAddress(addr);
959 if ((Capacity() + Page::kPageSize) > max_capacity_) return false;
974 Page* p = heap()->isolate()->memory_allocator()->AllocatePage(size, this,
1039 void PagedSpace::ObtainFreeListStatistics(Page* page, SizeStats* sizes) {
1040 sizes->huge_size_ = page->available_in_huge_free_list();
1041 sizes->small_size_ = page->available_in_small_free_list();
1042 sizes->medium_size_ = page->available_in_medium_free_list();
1043 sizes->large_size_ = page->available_in_large_free_list();
1050 Page* page = page_iterator.next();
1051 page->ResetFreeListStatistics();
1061 void PagedSpace::ReleasePage(Page* page) {
1062 DCHECK(page->LiveBytes() == 0);
1063 DCHECK(AreaSize() == page->area_size());
1065 if (page->WasSwept()) {
1066 intptr_t size = free_list_.EvictFreeListItems(page);
1070 DecreaseUnsweptFreeBytes(page);
1073 if (page->IsFlagSet(MemoryChunk::SCAN_ON_SCAVENGE)) {
1075 page->ClearFlag(MemoryChunk::SCAN_ON_SCAVENGE);
1078 DCHECK(!free_list_.ContainsPageFreeListItems(page));
1080 if (Page::FromAllocationTop(allocation_info_.top()) == page) {
1085 page->Unlink();
1086 if (page->IsFlagSet(MemoryChunk::CONTAINS_ONLY_DATA)) {
1087 heap()->isolate()->memory_allocator()->Free(page);
1089 heap()->QueueMemoryChunkForFree(page);
1104 Page* page = static_cast<Page*>(emergency_memory_);
1105 DCHECK(page->LiveBytes() == 0);
1106 DCHECK(AreaSize() == page->area_size());
1107 DCHECK(!free_list_.ContainsPageFreeListItems(page));
1108 heap()->isolate()->memory_allocator()->Free(page);
1114 Page* page = Page::Initialize(heap(), emergency_memory_, executable(), this);
1115 page->InsertAfter(anchor_.prev_page());
1130 Page* page = page_iterator.next();
1131 CHECK(page->owner() == this);
1132 if (page == Page::FromAllocationTop(allocation_info_.top())) {
1135 CHECK(page->WasSwept());
1136 HeapObjectIterator it(page, NULL);
1137 Address end_of_previous_object = page->area_start();
1138 Address top = page->area_end();
1165 CHECK_LE(black_size, page->LiveBytes());
1283 int rounded_new_capacity = RoundUp(new_capacity, Page::kPageSize);
1330 // Normal limit is the end of the current page.
1346 // The current page is already empty. Don't try to make another.
1349 // than what can be stored in a single page.
1355 // Failed to get a new page in to-space.
1359 // Clear remainder of current page.
1389 // Switched to new page. Try allocating again.
1441 // At end of page, switch to next page.
1442 NewSpacePage* page = NewSpacePage::FromLimit(current)->next_page();
1443 // Next page should be valid.
1444 CHECK(!page->is_anchor());
1445 current = page->area_start();
1468 DCHECK(maximum_capacity >= Page::kPageSize);
1469 initial_total_capacity_ = RoundDown(initial_capacity, Page::kPageSize);
1471 maximum_total_capacity_ = RoundDown(maximum_capacity, Page::kPageSize);
1490 int pages = total_capacity_ / Page::kPageSize;
1499 NewSpacePage::Initialize(heap(), start_ + i * Page::kPageSize, this);
1541 DCHECK((new_capacity & Page::kPageAlignmentMask) == 0);
1544 int pages_before = total_capacity_ / Page::kPageSize;
1545 int pages_after = new_capacity / Page::kPageSize;
1558 Address page_address = start_ + i * Page::kPageSize;
1563 // Duplicate the flags that was set on the old page.
1573 DCHECK((new_capacity & Page::kPageAlignmentMask) == 0);
1585 int pages_after = new_capacity / Page::kPageSize;
1587 NewSpacePage::FromAddress(start_ + (pages_after - 1) * Page::kPageSize);
1608 NewSpacePage* page = anchor_.next_page();
1609 while (page != &anchor_) {
1610 page->set_owner(this);
1611 page->SetFlags(flags, mask);
1613 page->ClearFlag(MemoryChunk::IN_FROM_SPACE);
1614 page->SetFlag(MemoryChunk::IN_TO_SPACE);
1615 page->ClearFlag(MemoryChunk::NEW_SPACE_BELOW_AGE_MARK);
1616 page->ResetLiveBytes();
1618 page->SetFlag(MemoryChunk::IN_FROM_SPACE);
1619 page->ClearFlag(MemoryChunk::IN_TO_SPACE);
1621 DCHECK(page->IsFlagSet(MemoryChunk::SCAN_ON_SCAVENGE));
1622 DCHECK(page->IsFlagSet(MemoryChunk::IN_TO_SPACE) ||
1623 page->IsFlagSet(MemoryChunk::IN_FROM_SPACE));
1624 page = page->next_page();
1645 // Fixup back-pointers to the page list anchor now that its address
1682 NewSpacePage* page = anchor_.next_page();
1684 while (page != &anchor_) {
1685 CHECK(page->semi_space() == this);
1686 CHECK(page->InNewSpace());
1687 CHECK(page->IsFlagSet(is_from_space ? MemoryChunk::IN_FROM_SPACE
1689 CHECK(!page->IsFlagSet(is_from_space ? MemoryChunk::IN_TO_SPACE
1691 CHECK(page->IsFlagSet(MemoryChunk::POINTERS_TO_HERE_ARE_INTERESTING));
1695 if (page->heap()->incremental_marking()->IsMarking()) {
1696 CHECK(page->IsFlagSet(MemoryChunk::POINTERS_FROM_HERE_ARE_INTERESTING));
1699 !page->IsFlagSet(MemoryChunk::POINTERS_FROM_HERE_ARE_INTERESTING));
1702 // black marking on the page (if we make it match in new-space).
1704 CHECK(page->IsFlagSet(MemoryChunk::SCAN_ON_SCAVENGE));
1705 CHECK(page->prev_page()->next_page() == page);
1706 page = page->next_page();
1714 NewSpacePage* page = NewSpacePage::FromLimit(start);
1716 SemiSpace* space = page->semi_space();
1718 // Start address is before end address, either on same page,
1719 // or end address is on a later page in the linked list of
1721 if (page == end_page) {
1724 while (page != end_page) {
1725 page = page->next_page();
1726 CHECK_NE(page, space->anchor());
2059 intptr_t FreeListCategory::EvictFreeListItemsInList(Page* p) {
2064 if (Page::FromAddress((*n)->address()) == p) {
2081 bool FreeListCategory::ContainsPageFreeListItemsInList(Page* p) {
2084 if (Page::FromAddress(node->address()) == p) return true;
2097 Page::FromAddress(node->address())->IsEvacuationCandidate()) {
2182 Page* page = Page::FromAddress(start);
2186 page->add_non_available_small_blocks(size_in_bytes);
2194 page->add_available_in_small_free_list(size_in_bytes);
2197 page->add_available_in_medium_free_list(size_in_bytes);
2200 page->add_available_in_large_free_list(size_in_bytes);
2203 page->add_available_in_huge_free_list(size_in_bytes);
2213 Page* page = NULL;
2219 page = Page::FromAddress(node->address());
2220 page->add_available_in_small_free_list(-(*node_size));
2230 page = Page::FromAddress(node->address());
2231 page->add_available_in_medium_free_list(-(*node_size));
2241 page = Page::FromAddress(node->address());
2242 page->add_available_in_large_free_list(-(*node_size));
2254 Page::FromAddress(cur_node->address())->IsEvacuationCandidate()) {
2257 page = Page::FromAddress(cur_node->address());
2258 page->add_available_in_huge_free_list(-size);
2277 page = Page::FromAddress(node->address());
2278 page->add_available_in_huge_free_list(-size);
2298 page = Page::FromAddress(node->address());
2299 page->add_available_in_small_free_list(-(*node_size));
2305 page = Page::FromAddress(node->address());
2306 page->add_available_in_medium_free_list(-(*node_size));
2312 page = Page::FromAddress(node->address());
2313 page->add_available_in_large_free_list(-(*node_size));
2325 // or allocate a new page before retrying.
2360 // Verify that it did not turn the page of the new node into an evacuation
2401 intptr_t FreeList::EvictFreeListItems(Page* p) {
2418 bool FreeList::ContainsPageFreeListItems(Page* p) {
2519 if (Page::FromAllocationTop(allocation_info_.top())
2521 // Create filler object to keep page iterable if it was iterable.
2573 // Free list allocation failed and there is no next page. Fail if we have
2584 // Try to expand the space and allocate in the new next page.
2821 LargePage* page = first_page_;
2823 LOG(heap()->isolate(), DeleteEvent("LargeObjectChunk", page->address()));
2827 space, kAllocationActionFree, page->size());
2828 heap()->isolate()->memory_allocator()->Free(page);
2847 LargePage* page = heap()->isolate()->memory_allocator()->AllocateLargePage(
2849 if (page == NULL) return AllocationResult::Retry(identity());
2850 DCHECK(page->area_size() >= object_size);
2852 size_ += static_cast<int>(page->size());
2855 page->set_next_page(first_page_);
2856 first_page_ = page;
2863 // this large page in the chunk map.
2864 uintptr_t base = reinterpret_cast<uintptr_t>(page) / MemoryChunk::kAlignment;
2865 uintptr_t limit = base + (page->size() - 1) / MemoryChunk::kAlignment;
2870 entry->value = page;
2873 HeapObject* object = page->GetObject();
2904 LargePage* page = FindPage(a);
2905 if (page != NULL) {
2906 return page->GetObject();
2918 LargePage* page = reinterpret_cast<LargePage*>(e->value);
2919 DCHECK(page->is_valid());
2920 if (page->Contains(a)) {
2921 return page;
2933 // Can this large page contain pointers to non-trivial objects. No other
2939 Page::FromAddress(object->address())->ResetProgressBar();
2940 Page::FromAddress(object->address())->ResetLiveBytes();
2944 LargePage* page = current;
2956 size_ -= static_cast<int>(page->size());
2960 // Remove entries belonging to this page.
2964 uintptr_t base = reinterpret_cast<uintptr_t>(page) / alignment;
2965 uintptr_t limit = base + (page->size() - 1) / alignment;
2972 heap()->QueueMemoryChunkForFree(page);
2974 heap()->isolate()->memory_allocator()->Free(page);
3000 page's
3003 Page* page = Page::FromAddress(object->address());
3004 CHECK(object->address() == page->area_start());
3084 void Page::Print() {
3085 // Make a best-effort to print the objects in the page.
3086 PrintF("Page@%p in %s\n", this->address(),