v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
cppgc::internal::ObjectAllocator Class Referencefinal

#include <object-allocator.h>

Inheritance diagram for cppgc::internal::ObjectAllocator:
Collaboration diagram for cppgc::internal::ObjectAllocator:

Public Types

using AlignVal = std::align_val_t
 

Public Member Functions

 ObjectAllocator (RawHeap &, PageBackend &, StatsCollector &, PreFinalizerHandler &, FatalOutOfMemoryHandler &, GarbageCollector &)
 
void * AllocateObject (size_t size, GCInfoIndex gcinfo)
 
void * AllocateObject (size_t size, AlignVal alignment, GCInfoIndex gcinfo)
 
void * AllocateObject (size_t size, GCInfoIndex gcinfo, CustomSpaceIndex space_index)
 
void * AllocateObject (size_t size, AlignVal alignment, GCInfoIndex gcinfo, CustomSpaceIndex space_index)
 
void ResetLinearAllocationBuffers ()
 
void MarkAllPagesAsYoung ()
 

Static Public Attributes

static constexpr size_t kSmallestSpaceSize = 32
 

Private Member Functions

bool in_disallow_gc_scope () const
 
void * AllocateObjectOnSpace (NormalPageSpace &, size_t, GCInfoIndex)
 
void * AllocateObjectOnSpace (NormalPageSpace &, size_t, AlignVal, GCInfoIndex)
 
void * OutOfLineAllocate (NormalPageSpace &, size_t, AlignVal, GCInfoIndex)
 
void V8_PRESERVE_MOST OutOfLineAllocateGCSafePoint (NormalPageSpace &, size_t, AlignVal, GCInfoIndex, void **)
 
void * OutOfLineAllocateImpl (NormalPageSpace &, size_t, AlignVal, GCInfoIndex)
 
bool TryRefillLinearAllocationBuffer (NormalPageSpace &, size_t)
 
bool TryRefillLinearAllocationBufferFromFreeList (NormalPageSpace &, size_t)
 
bool TryExpandAndRefillLinearAllocationBuffer (NormalPageSpace &)
 

Static Private Member Functions

static RawHeap::RegularSpaceType GetInitialSpaceIndexForSize (size_t size)
 

Private Attributes

RawHeapraw_heap_
 
PageBackendpage_backend_
 
StatsCollectorstats_collector_
 
PreFinalizerHandlerprefinalizer_handler_
 
FatalOutOfMemoryHandleroom_handler_
 
GarbageCollectorgarbage_collector_
 

Detailed Description

Definition at line 40 of file object-allocator.h.

Member Typedef Documentation

◆ AlignVal

Definition at line 42 of file object-allocator.h.

Constructor & Destructor Documentation

◆ ObjectAllocator()

cppgc::internal::ObjectAllocator::ObjectAllocator ( RawHeap & heap,
PageBackend & page_backend,
StatsCollector & stats_collector,
PreFinalizerHandler & prefinalizer_handler,
FatalOutOfMemoryHandler & oom_handler,
GarbageCollector & garbage_collector )

Definition at line 135 of file object-allocator.cc.

Member Function Documentation

◆ AllocateObject() [1/4]

void * cppgc::internal::ObjectAllocator::AllocateObject ( size_t size,
AlignVal alignment,
GCInfoIndex gcinfo )
inline

Definition at line 125 of file object-allocator.h.

Here is the call graph for this function:

◆ AllocateObject() [2/4]

void * cppgc::internal::ObjectAllocator::AllocateObject ( size_t size,
AlignVal alignment,
GCInfoIndex gcinfo,
CustomSpaceIndex space_index )
inline

Definition at line 152 of file object-allocator.h.

Here is the call graph for this function:

◆ AllocateObject() [3/4]

void * cppgc::internal::ObjectAllocator::AllocateObject ( size_t size,
GCInfoIndex gcinfo )
inline

Definition at line 112 of file object-allocator.h.

Here is the call graph for this function:

◆ AllocateObject() [4/4]

void * cppgc::internal::ObjectAllocator::AllocateObject ( size_t size,
GCInfoIndex gcinfo,
CustomSpaceIndex space_index )
inline

Definition at line 139 of file object-allocator.h.

Here is the call graph for this function:

◆ AllocateObjectOnSpace() [1/2]

void * cppgc::internal::ObjectAllocator::AllocateObjectOnSpace ( NormalPageSpace & space,
size_t size,
AlignVal alignment,
GCInfoIndex gcinfo )
inlineprivate

Definition at line 187 of file object-allocator.h.

Here is the call graph for this function:

◆ AllocateObjectOnSpace() [2/2]

void * cppgc::internal::ObjectAllocator::AllocateObjectOnSpace ( NormalPageSpace & space,
size_t size,
GCInfoIndex gcinfo )
inlineprivate

Definition at line 235 of file object-allocator.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetInitialSpaceIndexForSize()

RawHeap::RegularSpaceType cppgc::internal::ObjectAllocator::GetInitialSpaceIndexForSize ( size_t size)
inlinestaticprivate

Definition at line 167 of file object-allocator.h.

Here is the caller graph for this function:

◆ in_disallow_gc_scope()

bool cppgc::internal::ObjectAllocator::in_disallow_gc_scope ( ) const
private

Definition at line 370 of file object-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MarkAllPagesAsYoung()

void cppgc::internal::ObjectAllocator::MarkAllPagesAsYoung ( )

Definition at line 350 of file object-allocator.cc.

◆ OutOfLineAllocate()

void * cppgc::internal::ObjectAllocator::OutOfLineAllocate ( NormalPageSpace & space,
size_t size,
AlignVal alignment,
GCInfoIndex gcinfo )
inlineprivate

Definition at line 179 of file object-allocator.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OutOfLineAllocateGCSafePoint()

void cppgc::internal::ObjectAllocator::OutOfLineAllocateGCSafePoint ( NormalPageSpace & space,
size_t size,
AlignVal alignment,
GCInfoIndex gcinfo,
void ** object )
private

Definition at line 147 of file object-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OutOfLineAllocateImpl()

void * cppgc::internal::ObjectAllocator::OutOfLineAllocateImpl ( NormalPageSpace & space,
size_t size,
AlignVal alignment,
GCInfoIndex gcinfo )
private

Definition at line 174 of file object-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ResetLinearAllocationBuffers()

void cppgc::internal::ObjectAllocator::ResetLinearAllocationBuffers ( )

Definition at line 331 of file object-allocator.cc.

Here is the caller graph for this function:

◆ TryExpandAndRefillLinearAllocationBuffer()

bool cppgc::internal::ObjectAllocator::TryExpandAndRefillLinearAllocationBuffer ( NormalPageSpace & space)
private

Definition at line 254 of file object-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TryRefillLinearAllocationBuffer()

bool cppgc::internal::ObjectAllocator::TryRefillLinearAllocationBuffer ( NormalPageSpace & space,
size_t size )
private

Definition at line 267 of file object-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TryRefillLinearAllocationBufferFromFreeList()

bool cppgc::internal::ObjectAllocator::TryRefillLinearAllocationBufferFromFreeList ( NormalPageSpace & space,
size_t size )
private

Definition at line 314 of file object-allocator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ garbage_collector_

GarbageCollector& cppgc::internal::ObjectAllocator::garbage_collector_
private

Definition at line 104 of file object-allocator.h.

◆ kSmallestSpaceSize

size_t cppgc::internal::ObjectAllocator::kSmallestSpaceSize = 32
staticconstexpr

Definition at line 43 of file object-allocator.h.

◆ oom_handler_

FatalOutOfMemoryHandler& cppgc::internal::ObjectAllocator::oom_handler_
private

Definition at line 103 of file object-allocator.h.

◆ page_backend_

PageBackend& cppgc::internal::ObjectAllocator::page_backend_
private

Definition at line 100 of file object-allocator.h.

◆ prefinalizer_handler_

PreFinalizerHandler& cppgc::internal::ObjectAllocator::prefinalizer_handler_
private

Definition at line 102 of file object-allocator.h.

◆ raw_heap_

RawHeap& cppgc::internal::ObjectAllocator::raw_heap_
private

Definition at line 99 of file object-allocator.h.

◆ stats_collector_

StatsCollector& cppgc::internal::ObjectAllocator::stats_collector_
private

Definition at line 101 of file object-allocator.h.


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