v8  3.25.30(node0.11.13)
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 ()
 
V8_INLINE bool IsOutsideAllocatedSpace (const void *address) const
 
MemoryChunkAllocateChunk (intptr_t reserve_area_size, intptr_t commit_area_size, Executability executable, Space *space)
 
Address ReserveAlignedMemory (size_t requested, size_t alignment, VirtualMemory *controller)
 
Address AllocateAlignedMemory (size_t reserve_size, size_t commit_size, size_t alignment, Executability executable, VirtualMemory *controller)
 
bool CommitMemory (Address addr, size_t size, Executability executable)
 
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)
 
MUST_USE_RESULT bool CommitExecutableMemory (VirtualMemory *vm, Address start, size_t commit_size, size_t reserved_size)
 

Static Public Member Functions

static int CodePageGuardStartOffset ()
 
static int CodePageGuardSize ()
 
static int CodePageAreaStartOffset ()
 
static int CodePageAreaEndOffset ()
 
static int CodePageAreaSize ()
 

Detailed Description

Definition at line 1078 of file spaces.h.

Constructor & Destructor Documentation

MemoryAllocator ( Isolate isolate)
explicit

Definition at line 277 of file spaces.cc.

Member Function Documentation

void AddMemoryAllocationCallback ( MemoryAllocationCallback  callback,
ObjectSpace  space,
AllocationAction  action 
)
Address AllocateAlignedMemory ( size_t  reserve_size,
size_t  commit_size,
size_t  alignment,
Executability  executable,
VirtualMemory controller 
)
LargePage * AllocateLargePage ( intptr_t  object_size,
Space owner,
Executability  executable 
)

Definition at line 739 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 1103 of file spaces.h.

int CodePageAreaEndOffset ( )
static

Definition at line 880 of file spaces.cc.

References OS::CommitPageSize().

Referenced by MemoryAllocator::CodePageAreaSize().

static int CodePageAreaSize ( )
inlinestatic
bool CommitBlock ( Address  start,
size_t  size,
Executability  executable 
)
bool CommitMemory ( Address  addr,
size_t  size,
Executability  executable 
)
V8_INLINE bool IsOutsideAllocatedSpace ( const void *  address) const
inline

Definition at line 1118 of file spaces.h.

Referenced by Heap::Contains(), and Heap::InSpace().

intptr_t MaxAvailable ( )
inline
bool MemoryAllocationCallbackRegistered ( MemoryAllocationCallback  callback)

Definition at line 817 of file spaces.cc.

Referenced by MemoryAllocator::AddMemoryAllocationCallback().

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

Definition at line 837 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 288 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 1109 of file spaces.h.

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

void TearDown ( )

Definition at line 300 of file spaces.cc.

References ASSERT.

Referenced by Heap::TearDown().

bool UncommitBlock ( Address  start,
size_t  size 
)

Definition at line 790 of file spaces.cc.

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

Referenced by SemiSpace::ShrinkTo().


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