![]() |
v8
3.11.10(node0.8.26)
V8 is Google's open source JavaScript engine
|
#include <spaces.h>
Static Public Member Functions | |
static bool | ShouldBeSweptLazily (Page *p) |
![]() | |
static void | FatalProcessOutOfMemory () |
static void * | New (size_t size) |
static void | Delete (void *p) |
Protected Member Functions | |
intptr_t | SizeOfFirstPage () |
bool | Expand () |
HeapObject * | AllocateLinearly (int size_in_bytes) |
virtual MUST_USE_RESULT HeapObject * | SlowAllocateRaw (int size_in_bytes) |
Protected Attributes | |
int | area_size_ |
intptr_t | max_capacity_ |
AllocationStats | accounting_stats_ |
Page | anchor_ |
FreeList | free_list_ |
AllocationInfo | allocation_info_ |
int | page_extra_ |
bool | was_swept_conservatively_ |
Page * | first_unswept_page_ |
intptr_t | unswept_free_bytes_ |
Friends | |
class | PageIterator |
PagedSpace | ( | Heap * | heap, |
intptr_t | max_capacity, | ||
AllocationSpace | id, | ||
Executability | executable | ||
) |
Definition at line 775 of file spaces.cc.
References PagedSpace::accounting_stats_, PagedSpace::allocation_info_, PagedSpace::anchor_, PagedSpace::area_size_, PagedSpace::AreaSize(), v8::internal::CODE_SPACE, Page::InitializeAsAnchor(), Heap::isolate(), MemoryChunk::kObjectStartOffset, Page::kPageSize, AllocationInfo::limit, PagedSpace::max_capacity_, Isolate::memory_allocator(), v8::internal::NULL, v8::internal::RoundDown(), and AllocationInfo::top.
|
inlinevirtual |
bool AdvanceSweeper | ( | intptr_t | bytes_to_sweep | ) |
Definition at line 2274 of file spaces.cc.
References PagedSpace::anchor(), PagedSpace::DecreaseUnsweptFreeBytes(), PagedSpace::first_unswept_page_, Heap::FreeQueuedChunks(), MemoryChunk::FromAddress(), Space::heap(), PagedSpace::IsSweepingComplete(), Page::next_page(), v8::internal::NULL, v8::internal::PrintF(), PagedSpace::ShouldBeSweptLazily(), MarkCompactCollector::SweepConservatively(), and V8PRIxPTR.
Referenced by Heap::AdvanceSweepers(), and PagedSpace::SlowAllocateRaw().
|
inline |
Definition at line 1537 of file spaces.h.
References PagedSpace::accounting_stats_.
Referenced by PagedSpace::ReserveSpace().
|
inlineprotected |
Definition at line 252 of file spaces-inl.h.
References PagedSpace::allocation_info_, HeapObject::FromAddress(), AllocationInfo::limit, v8::internal::NULL, and AllocationInfo::top.
Referenced by PagedSpace::AllocateRaw().
|
inline |
Definition at line 263 of file spaces-inl.h.
References HeapObject::address(), PagedSpace::AllocateLinearly(), v8::internal::CODE_SPACE, PagedSpace::free_list_, Space::identity(), v8::internal::NULL, Failure::RetryAfterGC(), PagedSpace::SlowAllocateRaw(), and SkipList::Update().
Referenced by Heap::AllocateAsciiSymbol(), Heap::AllocateByteArray(), Heap::AllocateInternalSymbol(), Heap::AllocateRaw(), Heap::AllocateTwoByteSymbol(), Heap::CopyCode(), Heap::CreateCode(), TEST(), and MarkCompactCollector::TryPromoteObject().
|
inline |
Definition at line 1552 of file spaces.h.
References PagedSpace::anchor_.
Referenced by PagedSpace::AdvanceSweeper(), PagedSpace::PrepareForMarkCompact(), and PagedSpace::ReleasePage().
|
inline |
Definition at line 1626 of file spaces.h.
References PagedSpace::area_size_.
Referenced by PagedSpace::CanExpand(), MarkCompactCollector::CollectEvacuationCandidates(), Heap::CopyCode(), PagedSpace::Expand(), PagedSpace::PagedSpace(), PagedSpace::ReleaseAllUnusedPages(), PagedSpace::ReleasePage(), PagedSpace::ReserveSpace(), and PagedSpace::SizeOfFirstPage().
|
inline |
Definition at line 1486 of file spaces.h.
References PagedSpace::free_list_.
Referenced by Heap::Available(), Heap::PrintShortHeapStatistics(), and TEST().
bool CanExpand | ( | ) |
Definition at line 840 of file spaces.cc.
References PagedSpace::AreaSize(), ASSERT, PagedSpace::Capacity(), and PagedSpace::max_capacity_.
Referenced by PagedSpace::Expand().
|
inline |
Definition at line 1467 of file spaces.h.
References PagedSpace::accounting_stats_.
Referenced by PagedSpace::CanExpand(), Heap::Capacity(), PagedSpace::CommittedMemory(), PagedSpace::Expand(), Heap::RecordStats(), and PagedSpace::ReleasePage().
|
inline |
Definition at line 1478 of file spaces.h.
References PagedSpace::accounting_stats_.
|
inline |
Definition at line 1471 of file spaces.h.
References PagedSpace::Capacity().
Referenced by Heap::CommittedMemory().
|
inline |
Definition at line 178 of file spaces-inl.h.
References MemoryChunk::FromAddress(), MemoryChunk::is_valid(), and MemoryChunk::owner().
Referenced by StoreBuffer::Compact(), Heap::Contains(), StoreBuffer::EnterDirectlyIntoStoreBuffer(), PagedSpace::FindObject(), Heap::InSpace(), and StoreBuffer::Mark().
|
inline |
Definition at line 1455 of file spaces.h.
References HeapObject::address(), and PagedSpace::Contains().
Referenced by PagedSpace::Contains().
|
inline |
Definition at line 1614 of file spaces.h.
References PagedSpace::free_list_.
Referenced by MarkCompactCollector::CollectEvacuationCandidates().
int CountTotalPages | ( | ) |
Definition at line 906 of file spaces.cc.
References PagedSpace::PageIterator.
Referenced by MarkCompactCollector::CollectEvacuationCandidates().
|
inline |
Definition at line 1600 of file spaces.h.
References MemoryChunk::area_size(), ASSERT, MemoryChunk::LiveBytes(), PagedSpace::ShouldBeSweptLazily(), and PagedSpace::unswept_free_bytes_.
Referenced by PagedSpace::AdvanceSweeper(), and PagedSpace::ReleasePage().
void EvictEvacuationCandidatesFromFreeLists | ( | ) |
Definition at line 2304 of file spaces.cc.
References PagedSpace::allocation_info_, Heap::CreateFillerObjectAt(), Space::heap(), AllocationInfo::limit, v8::internal::NULL, and AllocationInfo::top.
Referenced by MarkCompactCollector::StartCompaction().
|
protected |
Definition at line 853 of file spaces.cc.
References MemoryAllocator::AllocatePage(), PagedSpace::anchor_, PagedSpace::AreaSize(), ASSERT, PagedSpace::CanExpand(), PagedSpace::Capacity(), Space::executable(), Space::heap(), MemoryChunk::InsertAfter(), Heap::isolate(), PagedSpace::max_capacity_, Isolate::memory_allocator(), Page::next_page(), v8::internal::NULL, Page::prev_page(), and PagedSpace::SizeOfFirstPage().
Referenced by PagedSpace::SlowAllocateRaw().
MaybeObject * FindObject | ( | Address | addr | ) |
Definition at line 822 of file spaces.cc.
References ASSERT, PagedSpace::Contains(), Failure::Exception(), MemoryChunk::FromAddress(), Space::heap(), HeapObjectIterator::Next(), v8::internal::NULL, and UNREACHABLE.
|
inline |
Definition at line 1611 of file spaces.h.
References PagedSpace::anchor_, and Page::next_page().
Referenced by TEST().
|
inline |
Definition at line 1519 of file spaces.h.
References PagedSpace::accounting_stats_, and PagedSpace::free_list_.
Referenced by Page::Initialize(), PagedSpace::PrepareForMarkCompact(), PagedSpace::ReserveSpace(), and MarkCompactCollector::SweepConservatively().
|
inline |
Definition at line 1541 of file spaces.h.
References PagedSpace::accounting_stats_.
Referenced by Page::Initialize().
|
inline |
Definition at line 1595 of file spaces.h.
References MemoryChunk::area_size(), ASSERT, MemoryChunk::LiveBytes(), PagedSpace::ShouldBeSweptLazily(), and PagedSpace::unswept_free_bytes_.
|
inline |
Definition at line 1591 of file spaces.h.
References PagedSpace::unswept_free_bytes_.
|
inline |
Definition at line 1607 of file spaces.h.
References PagedSpace::first_unswept_page_, and MemoryChunk::is_valid().
Referenced by PagedSpace::AdvanceSweeper(), Heap::IsSweepingComplete(), PagedSpace::SizeOfObjects(), PagedSpace::SlowAllocateRaw(), and IncrementalMarking::Start().
|
inline |
Definition at line 1612 of file spaces.h.
References PagedSpace::anchor_, and Page::prev_page().
Referenced by TEST().
|
inline |
Definition at line 1507 of file spaces.h.
References PagedSpace::allocation_info_, and AllocationInfo::limit.
Referenced by InnerPointerToCodeCache::GcSafeFindCodeForInnerPointer(), PagedSpace::PrepareForMarkCompact(), PagedSpace::ReserveSpace(), PagedSpace::SetTop(), and PagedSpace::SizeOfObjects().
|
virtual |
Reimplemented in FixedSpace.
Definition at line 2208 of file spaces.cc.
References PagedSpace::anchor(), Bitmap::Clear(), PagedSpace::first_unswept_page_, PagedSpace::Free(), PagedSpace::free_list_, MemoryChunk::FromAddress(), PagedSpace::limit(), Page::next_page(), v8::internal::NULL, v8::internal::PrintF(), PagedSpace::SetTop(), PagedSpace::top(), PagedSpace::unswept_free_bytes_, V8PRIxPTR, and Page::WasSwept().
Referenced by FixedSpace::PrepareForMarkCompact().
void ReleaseAllUnusedPages | ( | ) |
Definition at line 953 of file spaces.cc.
References MemoryChunk::area_start(), PagedSpace::AreaSize(), FreeSpace::cast(), PagedSpace::free_list_, Heap::FreeQueuedChunks(), HeapObject::FromAddress(), Space::heap(), MemoryChunk::LiveBytes(), PagedSpace::PageIterator, PagedSpace::ReleasePage(), FreeSpace::size(), and Page::WasSwept().
void ReleasePage | ( | Page * | page | ) |
Definition at line 917 of file spaces.cc.
References PagedSpace::accounting_stats_, PagedSpace::allocation_info_, PagedSpace::anchor(), MemoryChunk::area_size(), PagedSpace::AreaSize(), ASSERT, ASSERT_EQ, PagedSpace::Capacity(), MemoryChunk::CONTAINS_ONLY_DATA, PagedSpace::DecreaseUnsweptFreeBytes(), PagedSpace::first_unswept_page_, MemoryAllocator::Free(), PagedSpace::free_list_, MemoryChunk::FromAddress(), Space::heap(), MemoryChunk::IsFlagSet(), Heap::isolate(), AllocationInfo::limit, MemoryChunk::LiveBytes(), Isolate::memory_allocator(), Page::next_page(), v8::internal::NULL, Heap::QueueMemoryChunkForFree(), AllocationInfo::top, MemoryChunk::Unlink(), and Page::WasSwept().
Referenced by PagedSpace::ReleaseAllUnusedPages().
|
virtual |
Implements Space.
Definition at line 2242 of file spaces.cc.
References HeapObject::address(), PagedSpace::Allocate(), PagedSpace::allocation_info_, PagedSpace::AreaSize(), ASSERT, PagedSpace::Free(), PagedSpace::free_list_, AllocationInfo::limit, PagedSpace::limit(), v8::internal::NULL, Space::RoundSizeDownToObjectAlignment(), PagedSpace::SetTop(), PagedSpace::SlowAllocateRaw(), AllocationInfo::top, and PagedSpace::top().
Referenced by Heap::ReserveSpace().
|
inline |
Definition at line 1525 of file spaces.h.
References PagedSpace::free_list_.
|
inline |
Definition at line 1575 of file spaces.h.
References PagedSpace::was_swept_conservatively_.
|
inline |
Definition at line 1585 of file spaces.h.
References PagedSpace::anchor_, ASSERT, PagedSpace::first_unswept_page_, v8::internal::NULL, and PagedSpace::unswept_free_bytes_.
Definition at line 1530 of file spaces.h.
References PagedSpace::allocation_info_, ASSERT, MemoryChunk::FromAddress(), AllocationInfo::limit, PagedSpace::limit(), AllocationInfo::top, and PagedSpace::top().
Referenced by PagedSpace::PrepareForMarkCompact(), and PagedSpace::ReserveSpace().
bool SetUp | ( | ) |
Definition at line 801 of file spaces.cc.
Referenced by Heap::SetUp(), and TEST().
|
inlinestatic |
Definition at line 1579 of file spaces.h.
References MemoryChunk::IsEvacuationCandidate(), MemoryChunk::IsFlagSet(), MemoryChunk::RESCAN_ON_EVACUATION, and Page::WasSweptPrecisely().
Referenced by PagedSpace::AdvanceSweeper(), PagedSpace::DecreaseUnsweptFreeBytes(), and PagedSpace::IncreaseUnsweptFreeBytes().
|
inlinevirtual |
Implements Space.
Definition at line 1491 of file spaces.h.
References PagedSpace::accounting_stats_.
Referenced by Heap::PrintShortHeapStatistics(), and PagedSpace::SizeOfObjects().
|
protected |
Definition at line 874 of file spaces.cc.
References PagedSpace::AreaSize(), v8::internal::CELL_SPACE, v8::internal::CODE_SPACE, Space::identity(), v8::internal::KB, v8::internal::kPointerSize, v8::internal::MAP_SPACE, v8::internal::Min(), v8::internal::OLD_DATA_SPACE, v8::internal::OLD_POINTER_SPACE, and UNREACHABLE.
Referenced by PagedSpace::Expand().
|
inlinevirtual |
Reimplemented from Space.
Definition at line 1495 of file spaces.h.
References ASSERT, PagedSpace::IsSweepingComplete(), PagedSpace::limit(), PagedSpace::Size(), PagedSpace::top(), and PagedSpace::unswept_free_bytes_.
Referenced by MarkCompactCollector::CollectEvacuationCandidates(), Heap::PromotedSpaceSizeOfObjects(), and Heap::RecordStats().
|
protectedvirtual |
Definition at line 2319 of file spaces.cc.
References PagedSpace::AdvanceSweeper(), PagedSpace::Expand(), PagedSpace::first_unswept_page_, PagedSpace::free_list_, Space::heap(), MemoryChunk::is_valid(), PagedSpace::IsSweepingComplete(), v8::internal::kMaxInt, and v8::internal::NULL.
Referenced by PagedSpace::AllocateRaw(), and PagedSpace::ReserveSpace().
void TearDown | ( | ) |
Definition at line 811 of file spaces.cc.
References PagedSpace::accounting_stats_, PagedSpace::anchor_, MemoryAllocator::Free(), Space::heap(), Heap::isolate(), Isolate::memory_allocator(), PagedSpace::PageIterator, Page::set_next_page(), and Page::set_prev_page().
Referenced by Heap::TearDown(), and TEST().
|
inline |
Definition at line 1506 of file spaces.h.
References PagedSpace::allocation_info_, and AllocationInfo::top.
Referenced by InnerPointerToCodeCache::GcSafeFindCodeForInnerPointer(), PagedSpace::PrepareForMarkCompact(), PagedSpace::ReserveSpace(), PagedSpace::SetTop(), and PagedSpace::SizeOfObjects().
|
inline |
Definition at line 1574 of file spaces.h.
References PagedSpace::was_swept_conservatively_.
Referenced by HeapSnapshotGenerator::GenerateSnapshot().
|
inlinevirtual |
Definition at line 1503 of file spaces.h.
References PagedSpace::accounting_stats_.
Referenced by Heap::PrintShortHeapStatistics().
|
friend |
Definition at line 1679 of file spaces.h.
Referenced by PagedSpace::CountTotalPages(), PagedSpace::ReleaseAllUnusedPages(), and PagedSpace::TearDown().
|
protected |
Definition at line 1639 of file spaces.h.
Referenced by PagedSpace::Allocate(), PagedSpace::Capacity(), PagedSpace::ClearStats(), PagedSpace::Free(), PagedSpace::IncreaseCapacity(), PagedSpace::PagedSpace(), FixedSpace::PrepareForMarkCompact(), PagedSpace::ReleasePage(), PagedSpace::Size(), PagedSpace::TearDown(), and PagedSpace::Waste().
|
protected |
Definition at line 1648 of file spaces.h.
Referenced by PagedSpace::AllocateLinearly(), PagedSpace::EvictEvacuationCandidatesFromFreeLists(), PagedSpace::limit(), PagedSpace::PagedSpace(), PagedSpace::ReleasePage(), PagedSpace::ReserveSpace(), PagedSpace::SetTop(), and PagedSpace::top().
|
protected |
Definition at line 1642 of file spaces.h.
Referenced by PagedSpace::anchor(), PagedSpace::Expand(), PagedSpace::FirstPage(), PagedSpace::LastPage(), PagedSpace::PagedSpace(), PagedSpace::SetPagesToSweep(), and PagedSpace::TearDown().
|
protected |
Definition at line 1631 of file spaces.h.
Referenced by PagedSpace::AreaSize(), and PagedSpace::PagedSpace().
|
protected |
Definition at line 1660 of file spaces.h.
Referenced by PagedSpace::AdvanceSweeper(), PagedSpace::IsSweepingComplete(), PagedSpace::PrepareForMarkCompact(), PagedSpace::ReleasePage(), PagedSpace::SetPagesToSweep(), and PagedSpace::SlowAllocateRaw().
|
protected |
Definition at line 1645 of file spaces.h.
Referenced by PagedSpace::AllocateRaw(), PagedSpace::Available(), PagedSpace::CountFreeListItems(), PagedSpace::Free(), PagedSpace::PrepareForMarkCompact(), FixedSpace::PrepareForMarkCompact(), PagedSpace::ReleaseAllUnusedPages(), PagedSpace::ReleasePage(), PagedSpace::ReserveSpace(), PagedSpace::ResetFreeList(), and PagedSpace::SlowAllocateRaw().
|
protected |
Definition at line 1634 of file spaces.h.
Referenced by PagedSpace::CanExpand(), PagedSpace::Expand(), and PagedSpace::PagedSpace().
|
protected |
Definition at line 1654 of file spaces.h.
Referenced by FixedSpace::FixedSpace(), OldSpace::OldSpace(), and FixedSpace::PageAllocationLimit().
|
protected |
Definition at line 1665 of file spaces.h.
Referenced by PagedSpace::DecreaseUnsweptFreeBytes(), PagedSpace::IncreaseUnsweptFreeBytes(), PagedSpace::IncrementUnsweptFreeBytes(), PagedSpace::PrepareForMarkCompact(), PagedSpace::SetPagesToSweep(), and PagedSpace::SizeOfObjects().
|
protected |
Definition at line 1656 of file spaces.h.
Referenced by PagedSpace::set_was_swept_conservatively(), and PagedSpace::was_swept_conservatively().