v8  3.14.5(node0.10.28)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MemoryAllocator Class Reference

#include <spaces.h>

Public Member Functions

 MemoryAllocator (Isolate *isolate)
 
bool SetUp (intptr_t max_capacity, intptr_t capacity_executable)
 
void TearDown ()
 
PageAllocatePage (intptr_t size, PagedSpace *owner, Executability executable)
 
LargePageAllocateLargePage (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 ()
 
MemoryChunkAllocateChunk (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)
 

Detailed Description

Definition at line 953 of file spaces.h.

Constructor & Destructor Documentation

MemoryAllocator ( Isolate isolate)
explicit

Definition at line 264 of file spaces.cc.

Member Function Documentation

void AddMemoryAllocationCallback ( MemoryAllocationCallback  callback,
ObjectSpace  space,
AllocationAction  action 
)
LargePage * AllocateLargePage ( intptr_t  object_size,
Space owner,
Executability  executable 
)

Definition at line 589 of file spaces.cc.

References MemoryAllocator::AllocateChunk(), Isolate::heap(), and v8::internal::NULL.

Page * AllocatePage ( intptr_t  size,
PagedSpace owner,
Executability  executable 
)
intptr_t Available ( )
inline
intptr_t AvailableExecutable ( )
inline

Definition at line 978 of file spaces.h.

int CodePageAreaEndOffset ( )
static

Definition at line 727 of file spaces.cc.

References OS::CommitPageSize().

Referenced by MemoryAllocator::CodePageAreaSize().

static int CodePageAreaSize ( )
inlinestatic
int CodePageGuardSize ( )
static
bool CommitBlock ( Address  start,
size_t  size,
Executability  executable 
)
intptr_t MaxAvailable ( )
inline
bool MemoryAllocationCallbackRegistered ( MemoryAllocationCallback  callback)

Definition at line 664 of file spaces.cc.

Referenced by MemoryAllocator::AddMemoryAllocationCallback().

void PerformAllocationCallback ( ObjectSpace  space,
AllocationAction  action,
size_t  size 
)
void RemoveMemoryAllocationCallback ( MemoryAllocationCallback  callback)

Definition at line 684 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 
)
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().

intptr_t Size ( )
inline
intptr_t SizeExecutable ( )
inline

Definition at line 984 of file spaces.h.

Referenced by RegExpCompiler::Assemble(), and Heap::CommittedMemoryExecutable().

void TearDown ( )

Definition at line 285 of file spaces.cc.

References ASSERT.

Referenced by Heap::TearDown().

bool UncommitBlock ( Address  start,
size_t  size 
)

Definition at line 637 of file spaces.cc.

References Isolate::counters(), and VirtualMemory::UncommitRegion().

Referenced by SemiSpace::ShrinkTo().

void ZapBlock ( Address  start,
size_t  size 
)

The documentation for this class was generated from the following files: