v8
3.14.5(node0.10.28)
V8 is Google's open source JavaScript engine
|
#include <spaces.h>
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 | |
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 780 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 2309 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 1557 of file spaces.h.
References PagedSpace::accounting_stats_.
|
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(), 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::AllocateAsciiSymbol(), Heap::AllocateByteArray(), Heap::AllocateInternalSymbol(), Heap::AllocateRaw(), Heap::AllocateTwoByteSymbol(), Heap::CopyCode(), Heap::CreateCode(), Heap::ReserveSpace(), TEST(), and MarkCompactCollector::TryPromoteObject().
|
inline |
Definition at line 1572 of file spaces.h.
References PagedSpace::anchor_.
Referenced by PagedSpace::AdvanceSweeper(), PagedSpace::PrepareForMarkCompact(), and PagedSpace::ReleasePage().
|
inline |
Definition at line 1648 of file spaces.h.
References PagedSpace::area_size_.
Referenced by PagedSpace::CanExpand(), MarkCompactCollector::CollectEvacuationCandidates(), Heap::CopyCode(), Heap::CreateCode(), PagedSpace::Expand(), PagedSpace::PagedSpace(), PagedSpace::ReleaseAllUnusedPages(), PagedSpace::ReleasePage(), PagedSpace::ReserveSpace(), and PagedSpace::SizeOfFirstPage().
|
inline |
Definition at line 1506 of file spaces.h.
References PagedSpace::free_list_.
Referenced by Heap::Available(), StatisticsExtension::GetCounters(), Heap::PrintShortHeapStatistics(), and TEST().
bool CanExpand | ( | ) |
Definition at line 845 of file spaces.cc.
References PagedSpace::AreaSize(), ASSERT, PagedSpace::Capacity(), and PagedSpace::max_capacity_.
Referenced by PagedSpace::Expand().
|
inline |
Definition at line 1487 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 1498 of file spaces.h.
References PagedSpace::accounting_stats_.
Referenced by SimulateFullSpace().
|
inline |
Definition at line 1491 of file spaces.h.
References PagedSpace::Capacity().
Referenced by Heap::CommittedMemory(), StatisticsExtension::GetCounters(), and Heap::PrintShortHeapStatistics().
|
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 1471 of file spaces.h.
References HeapObject::address(), and PagedSpace::Contains().
Referenced by PagedSpace::Contains().
|
inline |
Definition at line 1636 of file spaces.h.
References PagedSpace::free_list_.
Referenced by MarkCompactCollector::CollectEvacuationCandidates().
int CountTotalPages | ( | ) |
Definition at line 911 of file spaces.cc.
References PagedSpace::PageIterator.
Referenced by MarkCompactCollector::CollectEvacuationCandidates(), and TEST().
|
inline |
Definition at line 1622 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 2339 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 858 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 827 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 1633 of file spaces.h.
References PagedSpace::anchor_, and Page::next_page().
Referenced by Heap::CreateCode(), and TEST().
|
inline |
Definition at line 1539 of file spaces.h.
References PagedSpace::accounting_stats_, and PagedSpace::free_list_.
Referenced by Page::Initialize(), PagedSpace::PrepareForMarkCompact(), PagedSpace::ReserveSpace(), SimulateFullSpace(), and MarkCompactCollector::SweepConservatively().
|
inline |
Definition at line 1561 of file spaces.h.
References PagedSpace::accounting_stats_.
Referenced by Page::Initialize().
|
inline |
Definition at line 1617 of file spaces.h.
References MemoryChunk::area_size(), ASSERT, MemoryChunk::LiveBytes(), PagedSpace::ShouldBeSweptLazily(), and PagedSpace::unswept_free_bytes_.
|
inline |
Definition at line 1613 of file spaces.h.
References PagedSpace::unswept_free_bytes_.
|
inline |
Definition at line 1629 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 1634 of file spaces.h.
References PagedSpace::anchor_, and Page::prev_page().
Referenced by TEST().
|
inline |
Definition at line 1527 of file spaces.h.
References PagedSpace::allocation_info_, and AllocationInfo::limit.
Referenced by InnerPointerToCodeCache::GcSafeFindCodeForInnerPointer(), PagedSpace::PrepareForMarkCompact(), PagedSpace::ReserveSpace(), PagedSpace::SetTop(), SimulateFullSpace(), and PagedSpace::SizeOfObjects().
|
virtual |
Reimplemented in FixedSpace.
Definition at line 2214 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 958 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 922 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 |
Definition at line 2295 of file spaces.cc.
References PagedSpace::free_list_, and Space::heap().
|
virtual |
Definition at line 2248 of file spaces.cc.
References HeapObject::address(), 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().
|
inline |
Definition at line 1545 of file spaces.h.
References PagedSpace::free_list_.
Referenced by SimulateFullSpace().
|
inline |
Definition at line 1597 of file spaces.h.
References PagedSpace::was_swept_conservatively_.
|
inline |
Definition at line 1607 of file spaces.h.
References PagedSpace::anchor_, ASSERT, PagedSpace::first_unswept_page_, v8::internal::NULL, and PagedSpace::unswept_free_bytes_.
Definition at line 1550 of file spaces.h.
References PagedSpace::allocation_info_, ASSERT, MemoryChunk::FromAddress(), AllocationInfo::limit, PagedSpace::limit(), AllocationInfo::top, and PagedSpace::top().
Referenced by PagedSpace::PrepareForMarkCompact(), PagedSpace::ReserveSpace(), and SimulateFullSpace().
bool SetUp | ( | ) |
Definition at line 806 of file spaces.cc.
Referenced by Heap::SetUp(), and TEST().
|
inlinestatic |
Definition at line 1601 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 1511 of file spaces.h.
References PagedSpace::accounting_stats_.
Referenced by StatisticsExtension::GetCounters(), and PagedSpace::SizeOfObjects().
|
protected |
Definition at line 879 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 1515 of file spaces.h.
References ASSERT, PagedSpace::IsSweepingComplete(), 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 2354 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 816 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 1526 of file spaces.h.
References PagedSpace::allocation_info_, and AllocationInfo::top.
Referenced by Deserializer::DeserializePartial(), InnerPointerToCodeCache::GcSafeFindCodeForInnerPointer(), PagedSpace::PrepareForMarkCompact(), PagedSpace::ReserveSpace(), PagedSpace::SetTop(), SimulateFullSpace(), and PagedSpace::SizeOfObjects().
|
inline |
Definition at line 1596 of file spaces.h.
References PagedSpace::was_swept_conservatively_.
Referenced by HeapSnapshotGenerator::GenerateSnapshot().
|
inlinevirtual |
Definition at line 1523 of file spaces.h.
References PagedSpace::accounting_stats_.
|
friend |
Definition at line 1701 of file spaces.h.
Referenced by PagedSpace::CountTotalPages(), PagedSpace::ReleaseAllUnusedPages(), and PagedSpace::TearDown().
|
protected |
Definition at line 1661 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 1670 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 1664 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 1653 of file spaces.h.
Referenced by PagedSpace::AreaSize(), and PagedSpace::PagedSpace().
|
protected |
Definition at line 1682 of file spaces.h.
Referenced by PagedSpace::AdvanceSweeper(), PagedSpace::IsSweepingComplete(), PagedSpace::PrepareForMarkCompact(), PagedSpace::ReleasePage(), PagedSpace::SetPagesToSweep(), and PagedSpace::SlowAllocateRaw().
|
protected |
Definition at line 1667 of file spaces.h.
Referenced by PagedSpace::AllocateRaw(), PagedSpace::Available(), PagedSpace::CountFreeListItems(), PagedSpace::Free(), PagedSpace::PrepareForMarkCompact(), FixedSpace::PrepareForMarkCompact(), PagedSpace::ReleaseAllUnusedPages(), PagedSpace::ReleasePage(), PagedSpace::RepairFreeListsAfterBoot(), PagedSpace::ReserveSpace(), PagedSpace::ResetFreeList(), and PagedSpace::SlowAllocateRaw().
|
protected |
Definition at line 1656 of file spaces.h.
Referenced by PagedSpace::CanExpand(), PagedSpace::Expand(), and PagedSpace::PagedSpace().
|
protected |
Definition at line 1676 of file spaces.h.
Referenced by FixedSpace::FixedSpace(), OldSpace::OldSpace(), and FixedSpace::PageAllocationLimit().
|
protected |
Definition at line 1687 of file spaces.h.
Referenced by PagedSpace::DecreaseUnsweptFreeBytes(), PagedSpace::IncreaseUnsweptFreeBytes(), PagedSpace::IncrementUnsweptFreeBytes(), PagedSpace::PrepareForMarkCompact(), PagedSpace::SetPagesToSweep(), and PagedSpace::SizeOfObjects().
|
protected |
Definition at line 1678 of file spaces.h.
Referenced by PagedSpace::set_was_swept_conservatively(), and PagedSpace::was_swept_conservatively().