v8
3.11.10(node0.8.26)
V8 is Google's open source JavaScript engine
|
#include <spaces.h>
Public Member Functions | |
MemoryAllocator (Isolate *isolate) | |
bool | SetUp (intptr_t max_capacity, intptr_t capacity_executable) |
void | TearDown () |
Page * | AllocatePage (intptr_t size, PagedSpace *owner, Executability executable) |
LargePage * | AllocateLargePage (intptr_t object_size, Space *owner, Executability executable) |
void | Free (MemoryChunk *chunk) |
intptr_t | Available () |
intptr_t | Size () |
intptr_t | AvailableExecutable () |
intptr_t | SizeExecutable () |
intptr_t | MaxAvailable () |
MemoryChunk * | AllocateChunk (intptr_t body_size, Executability executable, Space *space) |
Address | ReserveAlignedMemory (size_t requested, size_t alignment, VirtualMemory *controller) |
Address | AllocateAlignedMemory (size_t requested, size_t alignment, Executability executable, VirtualMemory *controller) |
void | FreeMemory (VirtualMemory *reservation, Executability executable) |
void | FreeMemory (Address addr, size_t size, Executability executable) |
bool | CommitBlock (Address start, size_t size, Executability executable) |
bool | UncommitBlock (Address start, size_t size) |
void | ZapBlock (Address start, size_t size) |
void | PerformAllocationCallback (ObjectSpace space, AllocationAction action, size_t size) |
void | AddMemoryAllocationCallback (MemoryAllocationCallback callback, ObjectSpace space, AllocationAction action) |
void | RemoveMemoryAllocationCallback (MemoryAllocationCallback callback) |
bool | MemoryAllocationCallbackRegistered (MemoryAllocationCallback callback) |
Static Public Member Functions | |
static int | CodePageGuardStartOffset () |
static int | CodePageGuardSize () |
static int | CodePageAreaStartOffset () |
static int | CodePageAreaEndOffset () |
static int | CodePageAreaSize () |
static MUST_USE_RESULT bool | CommitCodePage (VirtualMemory *vm, Address start, size_t size) |
|
explicit |
void AddMemoryAllocationCallback | ( | MemoryAllocationCallback | callback, |
ObjectSpace | space, | ||
AllocationAction | action | ||
) |
Definition at line 668 of file spaces.cc.
References List< T, P >::Add(), ASSERT, MemoryAllocator::MemoryAllocationCallbackRegistered(), and v8::internal::NULL.
Referenced by V8::AddMemoryAllocationCallback().
Address AllocateAlignedMemory | ( | size_t | requested, |
size_t | alignment, | ||
Executability | executable, | ||
VirtualMemory * | controller | ||
) |
Definition at line 356 of file spaces.cc.
References VirtualMemory::Commit(), MemoryAllocator::CommitCodePage(), v8::internal::EXECUTABLE, v8::internal::NULL, VirtualMemory::Release(), MemoryAllocator::ReserveAlignedMemory(), and VirtualMemory::TakeControl().
Referenced by MemoryAllocator::AllocateChunk().
MemoryChunk * AllocateChunk | ( | intptr_t | body_size, |
Executability | executable, | ||
Space * | space | ||
) |
Definition at line 490 of file spaces.cc.
References MemoryAllocator::AllocateAlignedMemory(), CodeRange::AllocateRawMemory(), ASSERT, Isolate::code_range(), MemoryAllocator::CodePageAreaStartOffset(), MemoryAllocator::CodePageGuardSize(), MemoryAllocator::CodePageGuardStartOffset(), OS::CommitPageSize(), Isolate::counters(), v8::internal::EXECUTABLE, CodeRange::exists(), Isolate::heap(), Space::identity(), MemoryChunk::Initialize(), v8::internal::IsAligned(), MemoryChunk::kAlignment, v8::kAllocationActionAllocate, MemoryChunk::kObjectStartOffset, LOG, v8::internal::NULL, MemoryAllocator::PerformAllocationCallback(), v8::internal::RoundUp(), MemoryChunk::set_reserved_memory(), VirtualMemory::size(), and MemoryAllocator::ZapBlock().
Referenced by MemoryAllocator::AllocateLargePage(), and MemoryAllocator::AllocatePage().
LargePage * AllocateLargePage | ( | intptr_t | object_size, |
Space * | owner, | ||
Executability | executable | ||
) |
Definition at line 586 of file spaces.cc.
References MemoryAllocator::AllocateChunk(), Isolate::heap(), and v8::internal::NULL.
Page * AllocatePage | ( | intptr_t | size, |
PagedSpace * | owner, | ||
Executability | executable | ||
) |
Definition at line 575 of file spaces.cc.
References MemoryAllocator::AllocateChunk(), Isolate::heap(), Page::Initialize(), and v8::internal::NULL.
Referenced by PagedSpace::Expand().
|
inline |
Definition at line 964 of file spaces.h.
Referenced by MemoryAllocator::MaxAvailable(), Heap::PrintShortHeapStatistics(), and Heap::RecordStats().
|
static |
Definition at line 722 of file spaces.cc.
References OS::CommitPageSize().
Referenced by MemoryAllocator::CodePageAreaSize().
|
inlinestatic |
Definition at line 1041 of file spaces.h.
References MemoryAllocator::CodePageAreaEndOffset(), and MemoryAllocator::CodePageAreaStartOffset().
Referenced by Serializer::SpaceAreaSize().
|
static |
Definition at line 715 of file spaces.cc.
References MemoryAllocator::CodePageGuardSize(), and MemoryAllocator::CodePageGuardStartOffset().
Referenced by MemoryAllocator::AllocateChunk(), MemoryAllocator::CodePageAreaSize(), and MemoryAllocator::CommitCodePage().
|
static |
Definition at line 710 of file spaces.cc.
References OS::CommitPageSize().
Referenced by MemoryAllocator::AllocateChunk(), MemoryAllocator::CodePageAreaStartOffset(), and MemoryAllocator::CommitCodePage().
|
static |
Definition at line 703 of file spaces.cc.
References OS::CommitPageSize(), MemoryChunk::kObjectStartOffset, and v8::internal::RoundUp().
Referenced by MemoryAllocator::AllocateChunk(), MemoryAllocator::CodePageAreaStartOffset(), and MemoryAllocator::CommitCodePage().
bool CommitBlock | ( | Address | start, |
size_t | size, | ||
Executability | executable | ||
) |
Definition at line 620 of file spaces.cc.
References VirtualMemory::CommitRegion(), Isolate::counters(), and MemoryAllocator::ZapBlock().
|
static |
Definition at line 729 of file spaces.cc.
References MemoryAllocator::CodePageAreaStartOffset(), MemoryAllocator::CodePageGuardSize(), MemoryAllocator::CodePageGuardStartOffset(), VirtualMemory::Commit(), and VirtualMemory::Guard().
Referenced by MemoryAllocator::AllocateAlignedMemory(), and CodeRange::AllocateRawMemory().
void Free | ( | MemoryChunk * | chunk | ) |
Definition at line 595 of file spaces.cc.
References MemoryChunk::address(), MemoryChunk::executable(), MemoryAllocator::FreeMemory(), Isolate::heap(), Space::identity(), MemoryChunk::IsEvacuationCandidate(), VirtualMemory::IsReserved(), v8::kAllocationActionFree, LOG, v8::internal::NULL, MemoryChunk::owner(), MemoryAllocator::PerformAllocationCallback(), Heap::RememberUnmappedPage(), MemoryChunk::reserved_memory(), MemoryChunk::size(), MemoryChunk::skip_list(), and MemoryChunk::slots_buffer().
Referenced by Heap::FreeQueuedChunks(), LargeObjectSpace::FreeUnmarkedObjects(), PagedSpace::ReleasePage(), PagedSpace::TearDown(), and LargeObjectSpace::TearDown().
void FreeMemory | ( | VirtualMemory * | reservation, |
Executability | executable | ||
) |
Definition at line 295 of file spaces.cc.
References VirtualMemory::address(), ASSERT, Isolate::code_range(), CodeRange::contains(), Isolate::counters(), v8::internal::EXECUTABLE, CodeRange::exists(), VirtualMemory::IsReserved(), v8::internal::NOT_EXECUTABLE, VirtualMemory::Release(), and VirtualMemory::size().
Referenced by MemoryAllocator::Free(), and NewSpace::TearDown().
void FreeMemory | ( | Address | addr, |
size_t | size, | ||
Executability | executable | ||
) |
Definition at line 317 of file spaces.cc.
References ASSERT, Isolate::code_range(), CodeRange::contains(), Isolate::counters(), v8::internal::EXECUTABLE, CodeRange::exists(), CodeRange::FreeRawMemory(), v8::internal::NOT_EXECUTABLE, VirtualMemory::ReleaseRegion(), and v8::internal::USE().
|
inline |
Definition at line 979 of file spaces.h.
References MemoryAllocator::Available(), Page::kMaxNonCodeHeapObjectSize, and Page::kPageSize.
bool MemoryAllocationCallbackRegistered | ( | MemoryAllocationCallback | callback | ) |
Definition at line 659 of file spaces.cc.
Referenced by MemoryAllocator::AddMemoryAllocationCallback().
void PerformAllocationCallback | ( | ObjectSpace | space, |
AllocationAction | action, | ||
size_t | size | ||
) |
Definition at line 646 of file spaces.cc.
Referenced by MemoryAllocator::AllocateChunk(), MemoryAllocator::Free(), and LargeObjectSpace::TearDown().
void RemoveMemoryAllocationCallback | ( | MemoryAllocationCallback | callback | ) |
Definition at line 679 of file spaces.cc.
References ASSERT, v8::internal::NULL, List< T, P >::Remove(), and UNREACHABLE.
Referenced by V8::RemoveMemoryAllocationCallback().
Address ReserveAlignedMemory | ( | size_t | requested, |
size_t | alignment, | ||
VirtualMemory * | controller | ||
) |
Definition at line 342 of file spaces.cc.
References VirtualMemory::address(), VirtualMemory::IsReserved(), v8::internal::NULL, v8::internal::RoundUp(), VirtualMemory::size(), and VirtualMemory::TakeControl().
Referenced by MemoryAllocator::AllocateAlignedMemory(), and NewSpace::SetUp().
bool SetUp | ( | intptr_t | max_capacity, |
intptr_t | capacity_executable | ||
) |
Definition at line 273 of file spaces.cc.
References ASSERT_GE, Page::kPageSize, and v8::internal::RoundUp().
Referenced by Heap::SetUp().
|
inline |
Definition at line 967 of file spaces.h.
Referenced by Heap::PrintShortHeapStatistics(), and Heap::RecordStats().
|
inline |
Definition at line 976 of file spaces.h.
Referenced by RegExpCompiler::Assemble(), and Heap::CommittedMemoryExecutable().
void TearDown | ( | ) |
bool UncommitBlock | ( | Address | start, |
size_t | size | ||
) |
Definition at line 632 of file spaces.cc.
References Isolate::counters(), and VirtualMemory::UncommitRegion().
Referenced by SemiSpace::ShrinkTo().
void ZapBlock | ( | Address | start, |
size_t | size | ||
) |
Definition at line 639 of file spaces.cc.
References Memory::Address_at(), v8::internal::kPointerSize, and v8::internal::kZapValue.
Referenced by MemoryAllocator::AllocateChunk(), and MemoryAllocator::CommitBlock().