V8 Project
|
#include <spaces.h>
Classes | |
struct | MemoryAllocationCallbackRegistration |
Static Public Member Functions | |
static int | CodePageGuardStartOffset () |
static int | CodePageGuardSize () |
static int | CodePageAreaStartOffset () |
static int | CodePageAreaEndOffset () |
static int | CodePageAreaSize () |
Private Member Functions | |
Page * | InitializePagesInChunk (int chunk_id, int pages_in_chunk, PagedSpace *owner) |
void | UpdateAllocatedSpaceLimits (void *low, void *high) |
DISALLOW_IMPLICIT_CONSTRUCTORS (MemoryAllocator) | |
Private Attributes | |
Isolate * | isolate_ |
size_t | capacity_ |
size_t | capacity_executable_ |
size_t | size_ |
size_t | size_executable_ |
void * | lowest_ever_allocated_ |
void * | highest_ever_allocated_ |
List< MemoryAllocationCallbackRegistration > | memory_allocation_callbacks_ |
|
explicit |
Definition at line 252 of file spaces.cc.
void v8::internal::MemoryAllocator::AddMemoryAllocationCallback | ( | MemoryAllocationCallback | callback, |
ObjectSpace | space, | ||
AllocationAction | action | ||
) |
Definition at line 772 of file spaces.cc.
References DCHECK, memory_allocation_callbacks_, MemoryAllocationCallbackRegistered(), NULL, and space().
Referenced by v8::V8::AddMemoryAllocationCallback().
Address v8::internal::MemoryAllocator::AllocateAlignedMemory | ( | size_t | reserve_size, |
size_t | commit_size, | ||
size_t | alignment, | ||
Executability | executable, | ||
base::VirtualMemory * | controller | ||
) |
Definition at line 358 of file spaces.cc.
References v8::base::VirtualMemory::Commit(), CommitExecutableMemory(), DCHECK, v8::internal::EXECUTABLE, NULL, v8::base::VirtualMemory::Release(), ReserveAlignedMemory(), v8::base::VirtualMemory::TakeControl(), and UpdateAllocatedSpaceLimits().
Referenced by AllocateChunk().
MemoryChunk * v8::internal::MemoryAllocator::AllocateChunk | ( | intptr_t | reserve_area_size, |
intptr_t | commit_area_size, | ||
Executability | executable, | ||
Space * | space | ||
) |
Definition at line 548 of file spaces.cc.
References AllocateAlignedMemory(), v8::internal::CodeRange::AllocateRawMemory(), capacity_executable_, v8::internal::Isolate::code_range(), CodePageAreaStartOffset(), CodePageGuardSize(), CodePageGuardStartOffset(), v8::base::OS::CommitPageSize(), v8::internal::Isolate::counters(), DCHECK, v8::internal::EXECUTABLE, v8::internal::Isolate::heap(), v8::internal::Space::identity(), v8::internal::MemoryChunk::Initialize(), v8::internal::IsAligned(), isolate_, v8::internal::MemoryChunk::kAlignment, v8::kAllocationActionAllocate, v8::internal::MemoryChunk::kObjectStartOffset, LOG, NULL, PerformAllocationCallback(), v8::internal::RoundUp(), v8::internal::MemoryChunk::set_reserved_memory(), v8::internal::Heap::ShouldZapGarbage(), v8::base::VirtualMemory::size(), size_, size_executable_, space(), v8::internal::CodeRange::valid(), and ZapBlock().
Referenced by v8::internal::AllocateCodeChunk(), AllocateLargePage(), AllocatePage(), and v8::internal::PagedSpace::CreateEmergencyMemory().
LargePage * v8::internal::MemoryAllocator::AllocateLargePage | ( | intptr_t | object_size, |
Space * | owner, | ||
Executability | executable | ||
) |
Definition at line 690 of file spaces.cc.
References AllocateChunk(), v8::internal::Isolate::heap(), v8::internal::LargePage::Initialize(), isolate_, and NULL.
Referenced by v8::internal::LargeObjectSpace::AllocateRaw().
Page * v8::internal::MemoryAllocator::AllocatePage | ( | intptr_t | size, |
PagedSpace * | owner, | ||
Executability | executable | ||
) |
Definition at line 680 of file spaces.cc.
References AllocateChunk(), v8::internal::Isolate::heap(), v8::internal::Page::Initialize(), isolate_, NULL, and size.
Referenced by v8::internal::PagedSpace::Expand().
|
inline |
Definition at line 1020 of file spaces.h.
References capacity_, and size_.
Referenced by MaxAvailable(), v8::internal::Heap::PrintShortHeapStatistics(), and v8::internal::Heap::RecordStats().
|
inline |
|
static |
Definition at line 827 of file spaces.cc.
References v8::base::OS::CommitPageSize(), and v8::internal::Page::kPageSize.
Referenced by CodePageAreaSize().
|
inlinestatic |
Definition at line 1103 of file spaces.h.
References CodePageAreaEndOffset(), and CodePageAreaStartOffset().
Referenced by v8::internal::PagedSpace::PagedSpace(), and v8::internal::Serializer::SpaceAreaSize().
|
static |
Definition at line 820 of file spaces.cc.
References CodePageGuardSize(), and CodePageGuardStartOffset().
Referenced by AllocateChunk(), CodePageAreaSize(), and CommitExecutableMemory().
|
static |
Definition at line 815 of file spaces.cc.
References v8::base::OS::CommitPageSize().
Referenced by AllocateChunk(), CodePageAreaStartOffset(), v8::internal::MemoryChunk::CommitArea(), and CommitExecutableMemory().
|
static |
Definition at line 808 of file spaces.cc.
References v8::base::OS::CommitPageSize(), v8::internal::MemoryChunk::kObjectStartOffset, and v8::internal::RoundUp().
Referenced by AllocateChunk(), CodePageAreaStartOffset(), and CommitExecutableMemory().
bool v8::internal::MemoryAllocator::CommitBlock | ( | Address | start, |
size_t | size, | ||
Executability | executable | ||
) |
Definition at line 723 of file spaces.cc.
References CommitMemory(), v8::internal::Isolate::counters(), isolate_, v8::internal::Heap::ShouldZapGarbage(), size, and ZapBlock().
bool v8::internal::MemoryAllocator::CommitExecutableMemory | ( | base::VirtualMemory * | vm, |
Address | start, | ||
size_t | commit_size, | ||
size_t | reserved_size | ||
) |
Definition at line 834 of file spaces.cc.
References CodePageAreaStartOffset(), CodePageGuardSize(), CodePageGuardStartOffset(), v8::base::VirtualMemory::Commit(), v8::base::VirtualMemory::Guard(), and UpdateAllocatedSpaceLimits().
Referenced by AllocateAlignedMemory(), and v8::internal::CodeRange::AllocateRawMemory().
bool v8::internal::MemoryAllocator::CommitMemory | ( | Address | addr, |
size_t | size, | ||
Executability | executable | ||
) |
Definition at line 284 of file spaces.cc.
References v8::base::VirtualMemory::CommitRegion(), v8::internal::EXECUTABLE, size, and UpdateAllocatedSpaceLimits().
Referenced by CommitBlock(), and v8::internal::CodeRange::CommitRawMemory().
|
private |
void v8::internal::MemoryAllocator::Free | ( | MemoryChunk * | chunk | ) |
Definition at line 700 of file spaces.cc.
References v8::internal::MemoryChunk::address(), v8::internal::MemoryChunk::executable(), FreeMemory(), v8::internal::Isolate::heap(), v8::internal::Space::identity(), v8::internal::MemoryChunk::IsEvacuationCandidate(), isolate_, v8::base::VirtualMemory::IsReserved(), v8::kAllocationActionFree, LOG, NULL, v8::internal::MemoryChunk::owner(), PerformAllocationCallback(), v8::internal::Heap::RememberUnmappedPage(), v8::internal::MemoryChunk::reserved_memory(), v8::internal::MemoryChunk::size(), v8::internal::MemoryChunk::skip_list(), v8::internal::MemoryChunk::slots_buffer(), and space().
Referenced by v8::internal::PagedSpace::FreeEmergencyMemory(), v8::internal::Heap::FreeQueuedChunks(), v8::internal::LargeObjectSpace::FreeUnmarkedObjects(), v8::internal::PagedSpace::ReleasePage(), v8::internal::PagedSpace::TearDown(), v8::internal::LargeObjectSpace::TearDown(), and v8::internal::DeoptimizerData::~DeoptimizerData().
void v8::internal::MemoryAllocator::FreeMemory | ( | Address | addr, |
size_t | size, | ||
Executability | executable | ||
) |
Definition at line 319 of file spaces.cc.
References v8::internal::Isolate::code_range(), v8::internal::CodeRange::contains(), v8::internal::Isolate::counters(), DCHECK, v8::internal::EXECUTABLE, v8::internal::CodeRange::FreeRawMemory(), isolate_, v8::internal::NOT_EXECUTABLE, NULL, v8::base::VirtualMemory::ReleaseRegion(), size, size_, size_executable_, USE(), and v8::internal::CodeRange::valid().
void v8::internal::MemoryAllocator::FreeMemory | ( | base::VirtualMemory * | reservation, |
Executability | executable | ||
) |
Definition at line 295 of file spaces.cc.
References v8::base::VirtualMemory::address(), v8::internal::Isolate::code_range(), v8::internal::CodeRange::contains(), v8::internal::Isolate::counters(), DCHECK, v8::internal::EXECUTABLE, isolate_, v8::base::VirtualMemory::IsReserved(), v8::internal::NOT_EXECUTABLE, NULL, v8::base::VirtualMemory::Release(), v8::base::VirtualMemory::size(), size, size_, size_executable_, and v8::internal::CodeRange::valid().
Referenced by Free(), and v8::internal::NewSpace::TearDown().
|
private |
|
inline |
Definition at line 1041 of file spaces.h.
References highest_ever_allocated_, and lowest_ever_allocated_.
Referenced by v8::internal::Heap::Contains(), and v8::internal::Heap::InSpace().
|
inline |
Definition at line 1035 of file spaces.h.
References Available(), v8::internal::Page::kMaxRegularHeapObjectSize, and v8::internal::Page::kPageSize.
Referenced by v8::internal::Heap::SelectGarbageCollector().
bool v8::internal::MemoryAllocator::MemoryAllocationCallbackRegistered | ( | MemoryAllocationCallback | callback | ) |
Definition at line 763 of file spaces.cc.
References memory_allocation_callbacks_.
Referenced by AddMemoryAllocationCallback().
void v8::internal::MemoryAllocator::PerformAllocationCallback | ( | ObjectSpace | space, |
AllocationAction | action, | ||
size_t | size | ||
) |
Definition at line 750 of file spaces.cc.
References v8::internal::MemoryAllocator::MemoryAllocationCallbackRegistration::action, v8::internal::MemoryAllocator::MemoryAllocationCallbackRegistration::callback, memory_allocation_callbacks_, size, space(), and v8::internal::MemoryAllocator::MemoryAllocationCallbackRegistration::space.
Referenced by AllocateChunk(), Free(), and v8::internal::LargeObjectSpace::TearDown().
void v8::internal::MemoryAllocator::RemoveMemoryAllocationCallback | ( | MemoryAllocationCallback | callback | ) |
Definition at line 782 of file spaces.cc.
References DCHECK, memory_allocation_callbacks_, NULL, and UNREACHABLE.
Referenced by v8::V8::RemoveMemoryAllocationCallback().
Address v8::internal::MemoryAllocator::ReserveAlignedMemory | ( | size_t | requested, |
size_t | alignment, | ||
base::VirtualMemory * | controller | ||
) |
Definition at line 345 of file spaces.cc.
References v8::base::VirtualMemory::address(), v8::base::VirtualMemory::IsReserved(), NULL, v8::internal::RoundUp(), v8::base::VirtualMemory::size(), size, size_, and v8::base::VirtualMemory::TakeControl().
Referenced by AllocateAlignedMemory(), and v8::internal::NewSpace::SetUp().
bool v8::internal::MemoryAllocator::SetUp | ( | intptr_t | max_capacity, |
intptr_t | capacity_executable | ||
) |
Definition at line 262 of file spaces.cc.
References capacity_, capacity_executable_, DCHECK_GE, v8::internal::Page::kPageSize, v8::internal::RoundUp(), size_, and size_executable_.
Referenced by v8::internal::Heap::SetUp().
|
inline |
Definition at line 1023 of file spaces.h.
References size_.
Referenced by v8::internal::StatisticsExtension::GetCounters(), v8::internal::Heap::PrintShortHeapStatistics(), v8::internal::Heap::RecordStats(), v8::internal::GCTracer::Start(), and v8::internal::GCTracer::Stop().
|
inline |
Definition at line 1032 of file spaces.h.
References size_executable_.
Referenced by v8::internal::RegExpCompiler::Assemble(), and v8::internal::Heap::CommittedMemoryExecutable().
void v8::internal::MemoryAllocator::TearDown | ( | ) |
Definition at line 274 of file spaces.cc.
References capacity_, capacity_executable_, DCHECK, and size_.
Referenced by v8::internal::Heap::TearDown().
Definition at line 736 of file spaces.cc.
References v8::internal::Isolate::counters(), isolate_, size, and v8::base::VirtualMemory::UncommitRegion().
Referenced by v8::internal::SemiSpace::ShrinkTo().
|
inlineprivate |
Definition at line 1152 of file spaces.h.
References highest_ever_allocated_, lowest_ever_allocated_, v8::internal::Max(), and v8::internal::Min().
Referenced by AllocateAlignedMemory(), CommitExecutableMemory(), and CommitMemory().
void v8::internal::MemoryAllocator::ZapBlock | ( | Address | start, |
size_t | size | ||
) |
Definition at line 743 of file spaces.cc.
References v8::internal::Memory::Address_at(), v8::internal::kPointerSize, v8::internal::kZapValue, and size.
Referenced by AllocateChunk(), v8::internal::MemoryChunk::CommitArea(), and CommitBlock().
|
private |
Definition at line 1115 of file spaces.h.
Referenced by Available(), SetUp(), and TearDown().
|
private |
Definition at line 1117 of file spaces.h.
Referenced by AllocateChunk(), AvailableExecutable(), SetUp(), and TearDown().
|
private |
Definition at line 1130 of file spaces.h.
Referenced by IsOutsideAllocatedSpace(), and UpdateAllocatedSpaceLimits().
|
private |
Definition at line 1112 of file spaces.h.
Referenced by AllocateChunk(), AllocateLargePage(), AllocatePage(), CommitBlock(), Free(), FreeMemory(), and UncommitBlock().
|
private |
Definition at line 1129 of file spaces.h.
Referenced by IsOutsideAllocatedSpace(), and UpdateAllocatedSpaceLimits().
|
private |
Definition at line 1143 of file spaces.h.
Referenced by AddMemoryAllocationCallback(), MemoryAllocationCallbackRegistered(), PerformAllocationCallback(), and RemoveMemoryAllocationCallback().
|
private |
Definition at line 1120 of file spaces.h.
Referenced by AllocateChunk(), Available(), FreeMemory(), ReserveAlignedMemory(), SetUp(), Size(), and TearDown().
|
private |
Definition at line 1122 of file spaces.h.
Referenced by AllocateChunk(), AvailableExecutable(), FreeMemory(), SetUp(), and SizeExecutable().