V8 Project
|
#include <spaces.h>
Classes | |
struct | SizeStats |
Static Public Member Functions | |
static bool | ShouldBeSweptBySweeperThreads (Page *p) |
![]() | |
static void | FatalProcessOutOfMemory () |
static void * | New (size_t size) |
static void | Delete (void *p) |
Protected Member Functions | |
FreeList * | free_list () |
intptr_t | SizeOfFirstPage () |
bool | Expand () |
HeapObject * | AllocateLinearly (int size_in_bytes) |
MUST_USE_RESULT HeapObject * | WaitForSweeperThreadsAndRetryAllocation (int size_in_bytes) |
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_ |
intptr_t | unswept_free_bytes_ |
Page * | end_of_unswept_pages_ |
MemoryChunk * | emergency_memory_ |
Friends | |
class | PageIterator |
class | MarkCompactCollector |
v8::internal::PagedSpace::PagedSpace | ( | Heap * | heap, |
intptr_t | max_capacity, | ||
AllocationSpace | id, | ||
Executability | executable | ||
) |
Definition at line 880 of file spaces.cc.
References accounting_stats_, allocation_info_, anchor_, area_size_, AreaSize(), v8::internal::CODE_SPACE, v8::internal::MemoryAllocator::CodePageAreaSize(), v8::internal::Space::heap(), v8::internal::Page::InitializeAsAnchor(), v8::internal::Heap::isolate(), v8::internal::MemoryChunk::kObjectStartOffset, v8::internal::Page::kPageSize, max_capacity_, v8::internal::Isolate::memory_allocator(), NULL, and RoundDown().
|
inlinevirtual |
|
inline |
Definition at line 1725 of file spaces.h.
References accounting_stats_.
|
inline |
Definition at line 1797 of file spaces.h.
References accounting_stats_.
Referenced by v8::internal::FreeList::Allocate().
|
inlineprotected |
Definition at line 237 of file spaces-inl.h.
References allocation_info_, v8::internal::HeapObject::FromAddress(), and NULL.
Referenced by AllocateRaw().
|
inline |
Definition at line 248 of file spaces-inl.h.
References v8::internal::HeapObject::address(), v8::internal::FreeList::Allocate(), AllocateLinearly(), v8::internal::CODE_SPACE, free_list_, v8::internal::Space::identity(), MSAN_ALLOCATED_UNINITIALIZED_MEMORY, NULL, v8::internal::AllocationResult::Retry(), SlowAllocateRaw(), and v8::internal::SkipList::Update().
Referenced by v8::internal::Heap::AllocateRaw(), v8::internal::ScavengingVisitor< marks_handling, logging_and_profiling_mode >::PromoteObject(), v8::internal::Heap::ReserveSpace(), and v8::internal::MarkCompactCollector::TryPromoteObject().
|
inline |
Definition at line 1758 of file spaces.h.
References allocation_info_, and v8::internal::AllocationInfo::limit_address().
Referenced by v8::internal::Heap::OldDataSpaceAllocationLimitAddress(), and v8::internal::Heap::OldPointerSpaceAllocationLimitAddress().
|
inline |
Definition at line 1755 of file spaces.h.
References allocation_info_, and v8::internal::AllocationInfo::top_address().
Referenced by v8::internal::Heap::OldDataSpaceAllocationTopAddress(), and v8::internal::Heap::OldPointerSpaceAllocationTopAddress().
|
inline |
Definition at line 1805 of file spaces.h.
References anchor_.
Referenced by v8::internal::HeapObjectIterator::AdvanceToNextPage().
|
inline |
Definition at line 1873 of file spaces.h.
References area_size_.
Referenced by CanExpand(), CreateEmergencyMemory(), Expand(), FreeEmergencyMemory(), PagedSpace(), ReleasePage(), and SizeOfFirstPage().
|
inline |
Definition at line 1733 of file spaces.h.
References v8::internal::FreeList::available(), and free_list_.
Referenced by v8::internal::Heap::Available(), v8::internal::StatisticsExtension::GetCounters(), and v8::internal::Heap::PrintShortHeapStatistics().
bool v8::internal::PagedSpace::CanExpand | ( | ) |
Definition at line 951 of file spaces.cc.
References AreaSize(), Capacity(), DCHECK, v8::internal::Page::kPageSize, and max_capacity_.
Referenced by Expand().
|
inline |
Definition at line 1688 of file spaces.h.
References accounting_stats_.
Referenced by CanExpand(), v8::internal::Heap::Capacity(), CommittedMemory(), Expand(), v8::internal::Heap::RecordStats(), and ReleasePage().
|
inline |
Definition at line 1719 of file spaces.h.
References accounting_stats_, and ResetFreeListStatistics().
|
inline |
Definition at line 1692 of file spaces.h.
References Capacity().
Referenced by v8::internal::Heap::CommittedMemory(), CommittedPhysicalMemory(), v8::internal::StatisticsExtension::GetCounters(), and v8::internal::Heap::PrintShortHeapStatistics().
size_t v8::internal::PagedSpace::CommittedPhysicalMemory | ( | ) |
Definition at line 920 of file spaces.cc.
References allocation_info_, CommittedMemory(), v8::base::VirtualMemory::HasLazyCommits(), PageIterator, size, and v8::internal::MemoryChunk::UpdateHighWaterMark().
Referenced by v8::internal::Heap::CommittedPhysicalMemory().
Definition at line 150 of file spaces-inl.h.
References v8::internal::MemoryChunk::FromAddress(), v8::internal::MemoryChunk::is_valid(), and v8::internal::MemoryChunk::owner().
Referenced by v8::internal::StoreBuffer::ClearDeadObject(), v8::internal::StoreBuffer::Compact(), v8::internal::Heap::Contains(), v8::internal::StoreBuffer::EnterDirectlyIntoStoreBuffer(), FindObject(), v8::internal::Heap::InOldDataSpace(), v8::internal::Heap::InOldPointerSpace(), v8::internal::Heap::InSpace(), and v8::internal::StoreBuffer::Mark().
|
inline |
Definition at line 1672 of file spaces.h.
References v8::internal::HeapObject::address(), and Contains().
Referenced by Contains().
int v8::internal::PagedSpace::CountTotalPages | ( | ) |
Definition at line 1028 of file spaces.cc.
References PageIterator.
Referenced by SlowAllocateRaw().
void v8::internal::PagedSpace::CreateEmergencyMemory | ( | ) |
Definition at line 1097 of file spaces.cc.
References v8::internal::MemoryAllocator::AllocateChunk(), AreaSize(), emergency_memory_, v8::internal::Space::executable(), v8::internal::Space::heap(), v8::internal::Heap::isolate(), and v8::internal::Isolate::memory_allocator().
|
inline |
Definition at line 1845 of file spaces.h.
References v8::internal::MemoryChunk::area_size(), DCHECK, v8::internal::MemoryChunk::LiveBytes(), ShouldBeSweptBySweeperThreads(), and unswept_free_bytes_.
Referenced by ReleasePage().
|
inline |
|
inline |
Definition at line 1789 of file spaces.h.
References Free(), limit(), NULL, SetTopAndLimit(), and top().
Referenced by PrepareForMarkCompact().
|
inline |
bool v8::internal::PagedSpace::EnsureSweeperProgress | ( | intptr_t | size_in_bytes | ) |
void v8::internal::PagedSpace::EvictEvacuationCandidatesFromFreeLists | ( | ) |
Definition at line 2516 of file spaces.cc.
References allocation_info_, v8::internal::Heap::CreateFillerObjectAt(), v8::internal::Space::heap(), and NULL.
Referenced by v8::internal::MarkCompactCollector::StartCompaction().
|
protected |
Definition at line 965 of file spaces.cc.
References v8::internal::MemoryAllocator::AllocatePage(), anchor_, AreaSize(), CanExpand(), Capacity(), DCHECK, v8::internal::Space::executable(), v8::internal::Space::heap(), v8::internal::MemoryChunk::InsertAfter(), v8::internal::Heap::isolate(), max_capacity_, v8::internal::Isolate::memory_allocator(), v8::internal::Page::next_page(), NULL, v8::internal::Page::prev_page(), size, and SizeOfFirstPage().
Referenced by SlowAllocateRaw().
Definition at line 932 of file spaces.cc.
References Contains(), DCHECK, v8::internal::MemoryChunk::FromAddress(), v8::internal::Smi::FromInt(), v8::internal::Space::heap(), v8::internal::HeapObjectIterator::Next(), NULL, and UNREACHABLE.
|
inline |
Definition at line 1862 of file spaces.h.
References anchor_, and v8::internal::Page::next_page().
Referenced by v8::internal::Heap::AllocateCode().
Definition at line 1770 of file spaces.h.
References accounting_stats_, v8::internal::FreeList::Free(), and free_list_.
Referenced by v8::internal::FreeList::Allocate(), and EmptyAllocationInfo().
|
inlineprotected |
void v8::internal::PagedSpace::FreeEmergencyMemory | ( | ) |
Definition at line 1103 of file spaces.cc.
References v8::internal::MemoryChunk::area_size(), AreaSize(), v8::internal::FreeList::ContainsPageFreeListItems(), DCHECK, emergency_memory_, v8::internal::MemoryAllocator::Free(), free_list_, v8::internal::Space::heap(), v8::internal::Heap::isolate(), v8::internal::MemoryChunk::LiveBytes(), v8::internal::Isolate::memory_allocator(), and NULL.
bool v8::internal::PagedSpace::HasBeenSetUp | ( | ) |
|
inline |
void v8::internal::PagedSpace::IncreaseCapacity | ( | int | size | ) |
Definition at line 1056 of file spaces.cc.
References accounting_stats_, and size.
|
inline |
Definition at line 1838 of file spaces.h.
References v8::internal::MemoryChunk::area_size(), DCHECK, v8::internal::MemoryChunk::LiveBytes(), ShouldBeSweptBySweeperThreads(), and unswept_free_bytes_.
|
inline |
|
inline |
|
inline |
Definition at line 1752 of file spaces.h.
References allocation_info_.
Referenced by v8::internal::FreeList::Allocate(), EmptyAllocationInfo(), v8::internal::HeapObjectIterator::FromCurrentPage(), v8::internal::InnerPointerToCodeCache::GcSafeFindCodeForInnerPointer(), SetTopAndLimit(), and SizeOfObjects().
|
inline |
Definition at line 1695 of file spaces.h.
References accounting_stats_.
Referenced by v8::internal::Heap::TearDown().
Definition at line 1039 of file spaces.cc.
References v8::internal::PagedSpace::SizeStats::huge_size_, v8::internal::PagedSpace::SizeStats::large_size_, v8::internal::PagedSpace::SizeStats::medium_size_, and v8::internal::PagedSpace::SizeStats::small_size_.
void v8::internal::PagedSpace::PrepareForMarkCompact | ( | ) |
Definition at line 2488 of file spaces.cc.
References EmptyAllocationInfo(), free_list_, v8::internal::FreeList::Reset(), and unswept_free_bytes_.
void v8::internal::PagedSpace::ReleasePage | ( | Page * | page | ) |
Definition at line 1061 of file spaces.cc.
References accounting_stats_, allocation_info_, v8::internal::MemoryChunk::area_size(), AreaSize(), Capacity(), v8::internal::MemoryChunk::ClearFlag(), v8::internal::MemoryChunk::CONTAINS_ONLY_DATA, v8::internal::FreeList::ContainsPageFreeListItems(), DCHECK, DCHECK_EQ, DecreaseUnsweptFreeBytes(), v8::internal::Heap::decrement_scan_on_scavenge_pages(), v8::internal::FreeList::EvictFreeListItems(), v8::internal::MemoryAllocator::Free(), free_list_, v8::internal::Space::heap(), v8::internal::MemoryChunk::IsFlagSet(), v8::internal::Heap::isolate(), v8::internal::MemoryChunk::LiveBytes(), v8::internal::Isolate::memory_allocator(), NULL, v8::internal::Heap::QueueMemoryChunkForFree(), v8::internal::MemoryChunk::SCAN_ON_SCAVENGE, size, v8::internal::MemoryChunk::Unlink(), and v8::internal::Page::WasSwept().
void v8::internal::PagedSpace::RepairFreeListsAfterBoot | ( | ) |
Definition at line 2513 of file spaces.cc.
References free_list_, v8::internal::Space::heap(), and v8::internal::FreeList::RepairLists().
|
inline |
Definition at line 1777 of file spaces.h.
References free_list_, and v8::internal::FreeList::Reset().
void v8::internal::PagedSpace::ResetFreeListStatistics | ( | ) |
Definition at line 1047 of file spaces.cc.
References PageIterator, and v8::internal::Page::ResetFreeListStatistics().
Referenced by ClearStats().
|
inline |
Definition at line 1850 of file spaces.h.
References unswept_free_bytes_.
Referenced by v8::internal::MarkCompactCollector::EnsureSweepingCompleted().
|
inline |
Definition at line 1780 of file spaces.h.
References allocation_info_, DCHECK, v8::internal::MemoryChunk::FromAddress(), limit(), top(), and v8::internal::MemoryChunk::UpdateHighWaterMark().
Referenced by v8::internal::FreeList::Allocate(), and EmptyAllocationInfo().
bool v8::internal::PagedSpace::SetUp | ( | ) |
Definition at line 903 of file spaces.cc.
Referenced by v8::internal::Heap::SetUp().
Definition at line 1831 of file spaces.h.
References v8::internal::MemoryChunk::IsEvacuationCandidate(), v8::internal::MemoryChunk::IsFlagSet(), v8::internal::MemoryChunk::RESCAN_ON_EVACUATION, and v8::internal::Page::WasSwept().
Referenced by DecreaseUnsweptFreeBytes(), and IncreaseUnsweptFreeBytes().
|
inlinevirtual |
Implements v8::internal::Space.
Definition at line 1739 of file spaces.h.
References accounting_stats_.
Referenced by v8::internal::StatisticsExtension::GetCounters(), and SizeOfObjects().
|
protected |
Definition at line 986 of file spaces.cc.
References AreaSize(), v8::internal::CELL_SPACE, v8::internal::Isolate::code_range(), v8::internal::CODE_SPACE, v8::internal::Space::heap(), v8::internal::Space::identity(), v8::internal::Heap::isolate(), v8::internal::KB, v8::internal::kPointerSize, v8::internal::MAP_SPACE, v8::internal::Min(), NULL, v8::internal::OLD_DATA_SPACE, v8::internal::OLD_POINTER_SPACE, v8::internal::PROPERTY_CELL_SPACE, v8::internal::RoundUp(), size, UNREACHABLE, and v8::internal::CodeRange::valid().
Referenced by Expand().
|
virtual |
Reimplemented from v8::internal::Space.
Definition at line 2502 of file spaces.cc.
References DCHECK, v8::internal::Space::heap(), limit(), Size(), top(), and unswept_free_bytes_.
Referenced by v8::internal::Heap::PrintShortHeapStatistics(), v8::internal::Heap::PromotedSpaceSizeOfObjects(), and v8::internal::Heap::RecordStats().
|
protected |
Definition at line 2547 of file spaces.cc.
References v8::internal::FreeList::Allocate(), v8::internal::FreeList::available(), CountTotalPages(), DCHECK, Expand(), free_list_, v8::internal::Space::heap(), v8::internal::Heap::mark_compact_collector(), NULL, v8::internal::MarkCompactCollector::RefillFreeList(), v8::internal::MarkCompactCollector::sweeping_in_progress(), v8::internal::MarkCompactCollector::SweepInParallel(), and WaitForSweeperThreadsAndRetryAllocation().
Referenced by AllocateRaw().
void v8::internal::PagedSpace::TearDown | ( | ) |
Definition at line 909 of file spaces.cc.
References accounting_stats_, anchor_, v8::internal::MemoryAllocator::Free(), v8::internal::Space::heap(), v8::internal::Heap::isolate(), v8::internal::Isolate::memory_allocator(), PageIterator, v8::internal::Page::set_next_page(), and v8::internal::Page::set_prev_page().
Referenced by v8::internal::Heap::TearDown().
|
inline |
Definition at line 1751 of file spaces.h.
References allocation_info_.
Referenced by v8::internal::FreeList::Allocate(), v8::internal::Deserializer::DeserializePartial(), EmptyAllocationInfo(), v8::internal::HeapObjectIterator::FromCurrentPage(), v8::internal::InnerPointerToCodeCache::GcSafeFindCodeForInnerPointer(), SetTopAndLimit(), and SizeOfObjects().
void v8::internal::PagedSpace::UseEmergencyMemory | ( | ) |
Definition at line 1113 of file spaces.cc.
References anchor_, emergency_memory_, v8::internal::Space::executable(), v8::internal::Space::heap(), v8::internal::Page::Initialize(), v8::internal::MemoryChunk::InsertAfter(), NULL, and v8::internal::Page::prev_page().
|
protected |
Definition at line 2532 of file spaces.cc.
References v8::internal::FreeList::Allocate(), v8::internal::MarkCompactCollector::EnsureSweepingCompleted(), free_list_, v8::internal::Space::heap(), v8::internal::Heap::mark_compact_collector(), NULL, and v8::internal::MarkCompactCollector::sweeping_in_progress().
Referenced by SlowAllocateRaw().
|
inlinevirtual |
|
friend |
|
friend |
Definition at line 1936 of file spaces.h.
Referenced by CommittedPhysicalMemory(), CountTotalPages(), ResetFreeListStatistics(), and TearDown().
|
protected |
Definition at line 1892 of file spaces.h.
Referenced by AddToAccountingStats(), Allocate(), Capacity(), ClearStats(), Free(), IncreaseCapacity(), MaximumCommittedMemory(), PagedSpace(), ReleasePage(), Size(), TearDown(), and Waste().
|
protected |
Definition at line 1901 of file spaces.h.
Referenced by AllocateLinearly(), allocation_limit_address(), allocation_top_address(), CommittedPhysicalMemory(), EvictEvacuationCandidatesFromFreeLists(), limit(), PagedSpace(), ReleasePage(), SetTopAndLimit(), and top().
|
protected |
Definition at line 1895 of file spaces.h.
Referenced by anchor(), Expand(), FirstPage(), LastPage(), PagedSpace(), TearDown(), and UseEmergencyMemory().
|
protected |
Definition at line 1884 of file spaces.h.
Referenced by AreaSize(), and PagedSpace().
|
protected |
Definition at line 1916 of file spaces.h.
Referenced by CreateEmergencyMemory(), FreeEmergencyMemory(), HasEmergencyMemory(), and UseEmergencyMemory().
|
protected |
Definition at line 1910 of file spaces.h.
Referenced by end_of_unswept_pages(), and set_end_of_unswept_pages().
|
protected |
Definition at line 1898 of file spaces.h.
Referenced by AllocateRaw(), Available(), Free(), free_list(), FreeEmergencyMemory(), PrepareForMarkCompact(), ReleasePage(), RepairFreeListsAfterBoot(), ResetFreeList(), SlowAllocateRaw(), and WaitForSweeperThreadsAndRetryAllocation().
|
protected |
Definition at line 1887 of file spaces.h.
Referenced by CanExpand(), Expand(), and PagedSpace().
|
protected |
Definition at line 1905 of file spaces.h.
Referenced by DecreaseUnsweptFreeBytes(), DecrementUnsweptFreeBytes(), IncreaseUnsweptFreeBytes(), IncrementUnsweptFreeBytes(), PrepareForMarkCompact(), ResetUnsweptFreeBytes(), and SizeOfObjects().