v8
3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
|
#include <spaces.h>
Data Structures | |
struct | SizeStats |
Static Public Member Functions | |
static bool | ShouldBeSweptLazily (Page *p) |
Static Public Member Functions inherited from Malloced | |
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) |
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_ |
bool | was_swept_conservatively_ |
Page * | first_unswept_page_ |
intptr_t | unswept_free_bytes_ |
Friends | |
class | PageIterator |
class | MarkCompactCollector |
PagedSpace | ( | Heap * | heap, |
intptr_t | max_capacity, | ||
AllocationSpace | id, | ||
Executability | executable | ||
) |
Definition at line 937 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, PagedSpace::max_capacity_, Isolate::memory_allocator(), v8::internal::NULL, and v8::internal::RoundDown().
|
inlinevirtual |
|
inline |
Definition at line 1775 of file spaces.h.
References PagedSpace::accounting_stats_.
Referenced by MarkCompactCollector::RefillFreeLists().
bool AdvanceSweeper | ( | intptr_t | bytes_to_sweep | ) |
Definition at line 2583 of file spaces.cc.
References PagedSpace::anchor(), PagedSpace::DecreaseUnsweptFreeBytes(), PagedSpace::first_unswept_page_, Heap::FreeQueuedChunks(), MemoryChunk::FromAddress(), Space::heap(), PagedSpace::IsLazySweepingComplete(), Page::next_page(), v8::internal::NULL, v8::internal::PrintF(), PagedSpace::ShouldBeSweptLazily(), and V8PRIxPTR.
Referenced by Heap::AdvanceSweepers(), PagedSpace::EnsureSweeperProgress(), and TEST().
|
inline |
Definition at line 1849 of file spaces.h.
References PagedSpace::accounting_stats_.
Referenced by FreeList::Allocate().
|
inlineprotected |
Definition at line 266 of file spaces-inl.h.
References PagedSpace::allocation_info_, HeapObject::FromAddress(), and v8::internal::NULL.
Referenced by PagedSpace::AllocateRaw().
|
inline |
Definition at line 277 of file spaces-inl.h.
References HeapObject::address(), FreeList::Allocate(), PagedSpace::AllocateLinearly(), PagedSpace::anchor_, ASSERT, v8::internal::CODE_SPACE, PagedSpace::free_list_, Space::heap(), Space::identity(), MemoryChunk::next_chunk(), v8::internal::NULL, MemoryChunk::prev_chunk(), Failure::RetryAfterGC(), PagedSpace::SlowAllocateRaw(), and SkipList::Update().
Referenced by Heap::AllocateRaw(), Heap::ReserveSpace(), TEST(), and MarkCompactCollector::TryPromoteObject().
|
inline |
Definition at line 1809 of file spaces.h.
References PagedSpace::allocation_info_, and AllocationInfo::limit_address().
Referenced by Heap::OldDataSpaceAllocationLimitAddress(), and Heap::OldPointerSpaceAllocationLimitAddress().
|
inline |
Definition at line 1804 of file spaces.h.
References PagedSpace::allocation_info_, and AllocationInfo::top_address().
Referenced by Heap::OldDataSpaceAllocationTopAddress(), and Heap::OldPointerSpaceAllocationTopAddress().
|
inline |
Definition at line 1859 of file spaces.h.
References PagedSpace::anchor_.
Referenced by PagedSpace::AdvanceSweeper(), PagedSpace::PrepareForMarkCompact(), PagedSpace::ReleasePage(), and TEST().
|
inline |
Definition at line 1944 of file spaces.h.
References PagedSpace::area_size_.
Referenced by PagedSpace::CanExpand(), MarkCompactCollector::CollectEvacuationCandidates(), Heap::CopyCode(), Heap::CreateCode(), PagedSpace::Expand(), PagedSpace::PagedSpace(), PagedSpace::ReleasePage(), and PagedSpace::SizeOfFirstPage().
|
inline |
Definition at line 1783 of file spaces.h.
References FreeList::available(), and PagedSpace::free_list_.
Referenced by Heap::Available(), StatisticsExtension::GetCounters(), Heap::PrintShortHeapStatistics(), and TEST().
bool CanExpand | ( | ) |
Definition at line 1015 of file spaces.cc.
References PagedSpace::AreaSize(), ASSERT, PagedSpace::Capacity(), and PagedSpace::max_capacity_.
Referenced by PagedSpace::Expand().
|
inline |
Definition at line 1738 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 1769 of file spaces.h.
References PagedSpace::accounting_stats_, and PagedSpace::ResetFreeListStatistics().
|
inline |
Definition at line 1742 of file spaces.h.
References PagedSpace::Capacity().
Referenced by Heap::CommittedMemory(), PagedSpace::CommittedPhysicalMemory(), StatisticsExtension::GetCounters(), and Heap::PrintShortHeapStatistics().
size_t CommittedPhysicalMemory | ( | ) |
Definition at line 984 of file spaces.cc.
References PagedSpace::allocation_info_, PagedSpace::CommittedMemory(), VirtualMemory::HasLazyCommits(), PagedSpace::PageIterator, v8::internal::size, and MemoryChunk::UpdateHighWaterMark().
Referenced by Heap::CommittedPhysicalMemory().
|
inline |
Definition at line 179 of file spaces-inl.h.
References MemoryChunk::FromAddress(), MemoryChunk::is_valid(), and MemoryChunk::owner().
Referenced by String::CanMakeExternal(), StoreBuffer::Compact(), Heap::Contains(), StoreBuffer::EnterDirectlyIntoStoreBuffer(), PagedSpace::FindObject(), Heap::InOldDataSpace(), Heap::InOldPointerSpace(), Heap::InSpace(), String::MakeExternal(), StoreBuffer::Mark(), and TEST().
|
inline |
Definition at line 1722 of file spaces.h.
References HeapObject::address(), and PagedSpace::Contains().
Referenced by PagedSpace::Contains().
int CountTotalPages | ( | ) |
Definition at line 1085 of file spaces.cc.
References PagedSpace::PageIterator.
Referenced by MarkCompactCollector::CollectEvacuationCandidates(), PagedSpace::SlowAllocateRaw(), and TEST().
|
inline |
Definition at line 1913 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().
|
inline |
Definition at line 1909 of file spaces.h.
References PagedSpace::unswept_free_bytes_.
Referenced by MarkCompactCollector::RefillFreeLists().
|
inline |
Definition at line 1841 of file spaces.h.
References PagedSpace::Free(), PagedSpace::limit(), v8::internal::NULL, PagedSpace::SetTopAndLimit(), and PagedSpace::top().
Referenced by PagedSpace::PrepareForMarkCompact().
bool EnsureSweeperProgress | ( | intptr_t | size_in_bytes | ) |
Definition at line 2632 of file spaces.cc.
References PagedSpace::AdvanceSweeper(), MarkCompactCollector::AreSweeperThreadsActivated(), Space::heap(), MarkCompactCollector::IsConcurrentSweepingInProgress(), Heap::mark_compact_collector(), MarkCompactCollector::RefillFreeLists(), MarkCompactCollector::sequential_sweeping(), and MarkCompactCollector::WaitUntilSweepingCompleted().
Referenced by Heap::EnsureSweepersProgressed(), and PagedSpace::SlowAllocateRaw().
void EvictEvacuationCandidatesFromFreeLists | ( | ) |
Definition at line 2616 of file spaces.cc.
References PagedSpace::allocation_info_, Heap::CreateFillerObjectAt(), Space::heap(), and v8::internal::NULL.
Referenced by MarkCompactCollector::StartCompaction().
|
protected |
Definition at line 1029 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(), v8::internal::size, and PagedSpace::SizeOfFirstPage().
Referenced by PagedSpace::SlowAllocateRaw().
MaybeObject * FindObject | ( | Address | addr | ) |
Definition at line 996 of file spaces.cc.
References ASSERT, PagedSpace::Contains(), Failure::Exception(), MemoryChunk::FromAddress(), Space::heap(), HeapObjectIterator::Next(), v8::internal::NULL, obj, and UNREACHABLE.
|
inline |
Definition at line 1933 of file spaces.h.
References PagedSpace::anchor_, and Page::next_page().
Referenced by Heap::CreateCode().
|
inline |
Definition at line 1821 of file spaces.h.
References PagedSpace::accounting_stats_, FreeList::Free(), and PagedSpace::free_list_.
Referenced by FreeList::Allocate(), PagedSpace::EmptyAllocationInfo(), and Page::Initialize().
|
inlineprotected |
Definition at line 1949 of file spaces.h.
References PagedSpace::free_list_.
Referenced by MarkCompactCollector::RefillFreeLists().
void IncreaseCapacity | ( | int | size | ) |
Definition at line 1113 of file spaces.cc.
References PagedSpace::accounting_stats_.
Referenced by Page::Initialize().
|
inline |
Definition at line 1904 of file spaces.h.
References MemoryChunk::area_size(), ASSERT, MemoryChunk::LiveBytes(), PagedSpace::ShouldBeSweptLazily(), and PagedSpace::unswept_free_bytes_.
|
inline |
Definition at line 1900 of file spaces.h.
References PagedSpace::unswept_free_bytes_.
|
inline |
Definition at line 1929 of file spaces.h.
References PagedSpace::first_unswept_page_, and MemoryChunk::is_valid().
Referenced by PagedSpace::AdvanceSweeper(), Heap::IsSweepingComplete(), and PagedSpace::SlowAllocateRaw().
|
inline |
Definition at line 1934 of file spaces.h.
References PagedSpace::anchor_, and Page::prev_page().
Referenced by TEST().
|
inline |
Definition at line 1801 of file spaces.h.
References PagedSpace::allocation_info_.
Referenced by FreeList::Allocate(), PagedSpace::EmptyAllocationInfo(), InnerPointerToCodeCache::GcSafeFindCodeForInnerPointer(), and PagedSpace::SizeOfObjects().
|
inline |
Definition at line 1745 of file spaces.h.
References PagedSpace::accounting_stats_.
Referenced by Heap::TearDown().
Definition at line 1096 of file spaces.cc.
References PagedSpace::SizeStats::huge_size_, PagedSpace::SizeStats::large_size_, PagedSpace::SizeStats::medium_size_, and PagedSpace::SizeStats::small_size_.
Referenced by MarkCompactCollector::CollectEvacuationCandidates().
void PrepareForMarkCompact | ( | ) |
Definition at line 2538 of file spaces.cc.
References PagedSpace::anchor(), Bitmap::Clear(), PagedSpace::EmptyAllocationInfo(), PagedSpace::first_unswept_page_, PagedSpace::free_list_, MemoryChunk::FromAddress(), Page::next_page(), v8::internal::NULL, v8::internal::PrintF(), FreeList::Reset(), PagedSpace::unswept_free_bytes_, V8PRIxPTR, and Page::WasSwept().
void ReleasePage | ( | Page * | page, |
bool | unlink | ||
) |
Definition at line 1118 of file spaces.cc.
References PagedSpace::accounting_stats_, PagedSpace::allocation_info_, PagedSpace::anchor(), MemoryChunk::area_size(), PagedSpace::AreaSize(), ASSERT, ASSERT_EQ, PagedSpace::Capacity(), CHECK, MemoryChunk::CONTAINS_ONLY_DATA, FreeList::ContainsPageFreeListItems(), PagedSpace::DecreaseUnsweptFreeBytes(), FreeList::EvictFreeListItems(), PagedSpace::first_unswept_page_, MemoryAllocator::Free(), PagedSpace::free_list_, MemoryChunk::FromAddress(), Space::heap(), MemoryChunk::IsFlagSet(), Heap::isolate(), MemoryChunk::LiveBytes(), Isolate::memory_allocator(), Page::next_page(), v8::internal::NULL, Heap::QueueMemoryChunkForFree(), v8::internal::size, MemoryChunk::Unlink(), and Page::WasSwept().
void RepairFreeListsAfterBoot | ( | ) |
Definition at line 2578 of file spaces.cc.
References PagedSpace::free_list_, Space::heap(), and FreeList::RepairLists().
|
inline |
Definition at line 1827 of file spaces.h.
References PagedSpace::free_list_, and FreeList::Reset().
void ResetFreeListStatistics | ( | ) |
Definition at line 1104 of file spaces.cc.
References PagedSpace::PageIterator, and Page::ResetFreeListStatistics().
Referenced by PagedSpace::ClearStats().
|
inline |
Definition at line 1918 of file spaces.h.
References PagedSpace::unswept_free_bytes_.
Referenced by MarkCompactCollector::WaitUntilSweepingCompleted().
|
inline |
Definition at line 1884 of file spaces.h.
References PagedSpace::was_swept_conservatively_.
|
inline |
Definition at line 1894 of file spaces.h.
References PagedSpace::anchor_, ASSERT, PagedSpace::first_unswept_page_, v8::internal::NULL, and PagedSpace::unswept_free_bytes_.
Definition at line 1832 of file spaces.h.
References PagedSpace::allocation_info_, ASSERT, MemoryChunk::FromAddress(), and MemoryChunk::UpdateHighWaterMark().
Referenced by FreeList::Allocate(), and PagedSpace::EmptyAllocationInfo().
bool SetUp | ( | ) |
Definition at line 963 of file spaces.cc.
Referenced by Heap::SetUp(), and TEST().
|
inlinestatic |
Definition at line 1888 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 1788 of file spaces.h.
References PagedSpace::accounting_stats_.
Referenced by StatisticsExtension::GetCounters(), and PagedSpace::SizeOfObjects().
|
protected |
Definition at line 1050 of file spaces.cc.
References PagedSpace::AreaSize(), v8::internal::CELL_SPACE, v8::internal::CODE_SPACE, Space::heap(), 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, v8::internal::PROPERTY_CELL_SPACE, v8::internal::size, and UNREACHABLE.
Referenced by PagedSpace::Expand().
|
virtual |
Reimplemented from Space.
Definition at line 2568 of file spaces.cc.
References ASSERT, Space::heap(), PagedSpace::limit(), PagedSpace::Size(), PagedSpace::top(), and PagedSpace::unswept_free_bytes_.
Referenced by MarkCompactCollector::CollectEvacuationCandidates(), Heap::PrintShortHeapStatistics(), Heap::PromotedSpaceSizeOfObjects(), and Heap::RecordStats().
|
protectedvirtual |
Definition at line 2651 of file spaces.cc.
References FreeList::Allocate(), ASSERT, FreeList::available(), PagedSpace::CountTotalPages(), PagedSpace::EnsureSweeperProgress(), PagedSpace::Expand(), PagedSpace::free_list_, Space::heap(), PagedSpace::IsLazySweepingComplete(), v8::internal::kMaxInt, and v8::internal::NULL.
Referenced by PagedSpace::AllocateRaw().
void TearDown | ( | ) |
Definition at line 973 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 1800 of file spaces.h.
References PagedSpace::allocation_info_.
Referenced by FreeList::Allocate(), Deserializer::DeserializePartial(), PagedSpace::EmptyAllocationInfo(), InnerPointerToCodeCache::GcSafeFindCodeForInnerPointer(), PagedSpace::SizeOfObjects(), and TEST().
|
inline |
Definition at line 1883 of file spaces.h.
References PagedSpace::was_swept_conservatively_.
Referenced by HeapSnapshotGenerator::GenerateSnapshot().
|
inlinevirtual |
Definition at line 1797 of file spaces.h.
References PagedSpace::accounting_stats_.
|
friend |
|
friend |
Definition at line 1993 of file spaces.h.
Referenced by PagedSpace::CommittedPhysicalMemory(), PagedSpace::CountTotalPages(), PagedSpace::ResetFreeListStatistics(), and PagedSpace::TearDown().
|
protected |
Definition at line 1959 of file spaces.h.
Referenced by PagedSpace::AddToAccountingStats(), PagedSpace::Allocate(), PagedSpace::Capacity(), PagedSpace::ClearStats(), PagedSpace::Free(), PagedSpace::IncreaseCapacity(), PagedSpace::MaximumCommittedMemory(), PagedSpace::PagedSpace(), PagedSpace::ReleasePage(), PagedSpace::Size(), PagedSpace::TearDown(), and PagedSpace::Waste().
|
protected |
Definition at line 1968 of file spaces.h.
Referenced by PagedSpace::AllocateLinearly(), PagedSpace::allocation_limit_address(), PagedSpace::allocation_top_address(), PagedSpace::CommittedPhysicalMemory(), PagedSpace::EvictEvacuationCandidatesFromFreeLists(), PagedSpace::limit(), PagedSpace::PagedSpace(), PagedSpace::ReleasePage(), PagedSpace::SetTopAndLimit(), and PagedSpace::top().
|
protected |
Definition at line 1962 of file spaces.h.
Referenced by PagedSpace::AllocateRaw(), PagedSpace::anchor(), PagedSpace::Expand(), PagedSpace::FirstPage(), PagedSpace::LastPage(), PagedSpace::PagedSpace(), PagedSpace::SetPagesToSweep(), and PagedSpace::TearDown().
|
protected |
Definition at line 1951 of file spaces.h.
Referenced by PagedSpace::AreaSize(), and PagedSpace::PagedSpace().
|
protected |
Definition at line 1974 of file spaces.h.
Referenced by PagedSpace::AdvanceSweeper(), PagedSpace::IsLazySweepingComplete(), PagedSpace::PrepareForMarkCompact(), PagedSpace::ReleasePage(), and PagedSpace::SetPagesToSweep().
|
protected |
Definition at line 1965 of file spaces.h.
Referenced by PagedSpace::AllocateRaw(), PagedSpace::Available(), PagedSpace::Free(), PagedSpace::free_list(), PagedSpace::PrepareForMarkCompact(), PagedSpace::ReleasePage(), PagedSpace::RepairFreeListsAfterBoot(), PagedSpace::ResetFreeList(), and PagedSpace::SlowAllocateRaw().
|
protected |
Definition at line 1954 of file spaces.h.
Referenced by PagedSpace::CanExpand(), PagedSpace::Expand(), and PagedSpace::PagedSpace().
|
protected |
Definition at line 1979 of file spaces.h.
Referenced by PagedSpace::DecreaseUnsweptFreeBytes(), PagedSpace::DecrementUnsweptFreeBytes(), PagedSpace::IncreaseUnsweptFreeBytes(), PagedSpace::IncrementUnsweptFreeBytes(), PagedSpace::PrepareForMarkCompact(), PagedSpace::ResetUnsweptFreeBytes(), PagedSpace::SetPagesToSweep(), and PagedSpace::SizeOfObjects().
|
protected |
Definition at line 1970 of file spaces.h.
Referenced by PagedSpace::set_was_swept_conservatively(), and PagedSpace::was_swept_conservatively().