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

#include <free-list.h>

Inheritance diagram for v8::internal::FreeList:
Collaboration diagram for v8::internal::FreeList:

Classes

class  FreeListCategoryIterator
 

Public Member Functions

 FreeList (int number_of_categories, size_t min_block_size)
 
virtual ~FreeList ()=default
 
virtual size_t Free (const WritableFreeSpace &free_space, FreeMode mode)
 
virtual V8_WARN_UNUSED_RESULT Tagged< FreeSpaceAllocate (size_t size_in_bytes, size_t *node_size, AllocationOrigin origin)=0
 
virtual V8_EXPORT_PRIVATE PageMetadataGetPageForSize (size_t size_in_bytes)=0
 
virtual void Reset ()
 
virtual void ResetForNonBlackAllocatedPages ()
 
size_t Available ()
 
void IncreaseAvailableBytes (size_t bytes)
 
void DecreaseAvailableBytes (size_t bytes)
 
size_t wasted_bytes () const
 
void increase_wasted_bytes (size_t bytes)
 
void decrease_wasted_bytes (size_t bytes)
 
bool IsEmpty ()
 
void RepairLists (Heap *heap)
 
V8_EXPORT_PRIVATE void EvictFreeListItems (PageMetadata *page)
 
int number_of_categories ()
 
FreeListCategoryType last_category ()
 
size_t min_block_size () const
 
template<typename Callback >
void ForAllFreeListCategories (FreeListCategoryType type, Callback callback)
 
template<typename Callback >
void ForAllFreeListCategories (Callback callback)
 
virtual bool AddCategory (FreeListCategory *category)
 
virtual V8_EXPORT_PRIVATE void RemoveCategory (FreeListCategory *category)
 
void PrintCategories (FreeListCategoryType type)
 

Static Public Member Functions

static V8_EXPORT_PRIVATE std::unique_ptr< FreeListCreateFreeList ()
 
static V8_EXPORT_PRIVATE std::unique_ptr< FreeListCreateFreeListForNewSpace ()
 

Protected Member Functions

void VerifyAvailable ()
 
Tagged< FreeSpaceTryFindNodeIn (FreeListCategoryType type, size_t minimum_size, size_t *node_size)
 
Tagged< FreeSpaceSearchForNodeInList (FreeListCategoryType type, size_t minimum_size, size_t *node_size)
 
virtual FreeListCategoryType SelectFreeListCategoryType (size_t size_in_bytes)=0
 
FreeListCategorytop (FreeListCategoryType type) const
 
PageMetadataGetPageForCategoryType (FreeListCategoryType type)
 

Protected Attributes

const int number_of_categories_ = 0
 
const FreeListCategoryType last_category_ = 0
 
size_t min_block_size_ = 0
 
FreeListCategory ** categories_ = nullptr
 
size_t available_ = 0
 
std::atomic< size_twasted_bytes_ = 0
 

Friends

class FreeListCategory
 
class PageMetadata
 
class MutablePageMetadata
 
class ReadOnlyPageMetadata
 
class MapSpace
 

Detailed Description

Definition at line 135 of file free-list.h.

Constructor & Destructor Documentation

◆ FreeList()

v8::internal::FreeList::FreeList ( int number_of_categories,
size_t min_block_size )

Definition at line 126 of file free-list.cc.

◆ ~FreeList()

virtual v8::internal::FreeList::~FreeList ( )
virtualdefault

Member Function Documentation

◆ AddCategory()

bool v8::internal::FreeList::AddCategory ( FreeListCategory * category)
virtual

Reimplemented in v8::internal::FreeListManyCached.

Definition at line 486 of file free-list.cc.

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

◆ Allocate()

virtual V8_WARN_UNUSED_RESULT Tagged< FreeSpace > v8::internal::FreeList::Allocate ( size_t size_in_bytes,
size_t * node_size,
AllocationOrigin origin )
pure virtual

Implemented in v8::internal::FreeListMany, v8::internal::FreeListManyCached, v8::internal::FreeListManyCachedFastPathBase, and v8::internal::FreeListManyCachedOrigin.

Here is the caller graph for this function:

◆ Available()

size_t v8::internal::FreeList::Available ( )
inline

Definition at line 169 of file free-list.h.

Here is the call graph for this function:

◆ CreateFreeList()

std::unique_ptr< FreeList > v8::internal::FreeList::CreateFreeList ( )
static

Definition at line 131 of file free-list.cc.

◆ CreateFreeListForNewSpace()

std::unique_ptr< FreeList > v8::internal::FreeList::CreateFreeListForNewSpace ( )
static

Definition at line 135 of file free-list.cc.

◆ decrease_wasted_bytes()

void v8::internal::FreeList::decrease_wasted_bytes ( size_t bytes)
inline

Definition at line 184 of file free-list.h.

◆ DecreaseAvailableBytes()

void v8::internal::FreeList::DecreaseAvailableBytes ( size_t bytes)
inline

Definition at line 176 of file free-list.h.

Here is the caller graph for this function:

◆ EvictFreeListItems()

void v8::internal::FreeList::EvictFreeListItems ( PageMetadata * page)

Definition at line 471 of file free-list.cc.

Here is the call graph for this function:

◆ ForAllFreeListCategories() [1/2]

template<typename Callback >
void v8::internal::FreeList::ForAllFreeListCategories ( Callback callback)
inline

Definition at line 211 of file free-list.h.

Here is the call graph for this function:

◆ ForAllFreeListCategories() [2/2]

template<typename Callback >
void v8::internal::FreeList::ForAllFreeListCategories ( FreeListCategoryType type,
Callback callback )
inline

Definition at line 201 of file free-list.h.

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

◆ Free()

size_t v8::internal::FreeList::Free ( const WritableFreeSpace & free_space,
FreeMode mode )
virtual

Reimplemented in v8::internal::FreeListManyCached.

Definition at line 175 of file free-list.cc.

Here is the call graph for this function:

◆ GetPageForCategoryType()

PageMetadata * v8::internal::FreeList::GetPageForCategoryType ( FreeListCategoryType type)
inlineprotected

Definition at line 26 of file free-list-inl.h.

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

◆ GetPageForSize()

virtual V8_EXPORT_PRIVATE PageMetadata * v8::internal::FreeList::GetPageForSize ( size_t size_in_bytes)
pure virtual

Implemented in v8::internal::FreeListMany.

◆ increase_wasted_bytes()

void v8::internal::FreeList::increase_wasted_bytes ( size_t bytes)
inline

Definition at line 181 of file free-list.h.

◆ IncreaseAvailableBytes()

void v8::internal::FreeList::IncreaseAvailableBytes ( size_t bytes)
inline

Definition at line 175 of file free-list.h.

Here is the caller graph for this function:

◆ IsEmpty()

bool v8::internal::FreeList::IsEmpty ( )
inline

Definition at line 36 of file free-list-inl.h.

Here is the call graph for this function:

◆ last_category()

FreeListCategoryType v8::internal::FreeList::last_category ( )
inline

Definition at line 196 of file free-list.h.

Here is the caller graph for this function:

◆ min_block_size()

size_t v8::internal::FreeList::min_block_size ( ) const
inline

Definition at line 198 of file free-list.h.

◆ number_of_categories()

int v8::internal::FreeList::number_of_categories ( )
inline

Definition at line 195 of file free-list.h.

Here is the caller graph for this function:

◆ PrintCategories()

void v8::internal::FreeList::PrintCategories ( FreeListCategoryType type)

Definition at line 528 of file free-list.cc.

Here is the call graph for this function:

◆ RemoveCategory()

void v8::internal::FreeList::RemoveCategory ( FreeListCategory * category)
virtual

Reimplemented in v8::internal::FreeListManyCached.

Definition at line 505 of file free-list.cc.

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

◆ RepairLists()

void v8::internal::FreeList::RepairLists ( Heap * heap)

Definition at line 481 of file free-list.cc.

Here is the call graph for this function:

◆ Reset()

void v8::internal::FreeList::Reset ( )
virtual

Reimplemented in v8::internal::FreeListManyCached.

Definition at line 442 of file free-list.cc.

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

◆ ResetForNonBlackAllocatedPages()

void v8::internal::FreeList::ResetForNonBlackAllocatedPages ( )
virtual

Reimplemented in v8::internal::FreeListManyCached.

Definition at line 452 of file free-list.cc.

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

◆ SearchForNodeInList()

Tagged< FreeSpace > v8::internal::FreeList::SearchForNodeInList ( FreeListCategoryType type,
size_t minimum_size,
size_t * node_size )
protected

Definition at line 155 of file free-list.cc.

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

◆ SelectFreeListCategoryType()

virtual FreeListCategoryType v8::internal::FreeList::SelectFreeListCategoryType ( size_t size_in_bytes)
protectedpure virtual

Implemented in v8::internal::FreeListMany.

Here is the caller graph for this function:

◆ top()

FreeListCategory * v8::internal::FreeList::top ( FreeListCategoryType type) const
inlineprotected

Definition at line 264 of file free-list.h.

◆ TryFindNodeIn()

Tagged< FreeSpace > v8::internal::FreeList::TryFindNodeIn ( FreeListCategoryType type,
size_t minimum_size,
size_t * node_size )
protected

Definition at line 139 of file free-list.cc.

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

◆ VerifyAvailable()

void v8::internal::FreeList::VerifyAvailable ( )
inlineprotected

Definition at line 245 of file free-list.h.

Here is the caller graph for this function:

◆ wasted_bytes()

size_t v8::internal::FreeList::wasted_bytes ( ) const
inline

Definition at line 178 of file free-list.h.

Friends And Related Symbol Documentation

◆ FreeListCategory

friend class FreeListCategory
friend

Definition at line 282 of file free-list.h.

◆ MapSpace

friend class MapSpace
friend

Definition at line 286 of file free-list.h.

◆ MutablePageMetadata

friend class MutablePageMetadata
friend

Definition at line 284 of file free-list.h.

◆ PageMetadata

friend class PageMetadata
friend

Definition at line 283 of file free-list.h.

◆ ReadOnlyPageMetadata

friend class ReadOnlyPageMetadata
friend

Definition at line 285 of file free-list.h.

Member Data Documentation

◆ available_

size_t v8::internal::FreeList::available_ = 0
protected

Definition at line 277 of file free-list.h.

◆ categories_

FreeListCategory** v8::internal::FreeList::categories_ = nullptr
protected

Definition at line 274 of file free-list.h.

◆ last_category_

const FreeListCategoryType v8::internal::FreeList::last_category_ = 0
protected

Definition at line 271 of file free-list.h.

◆ min_block_size_

size_t v8::internal::FreeList::min_block_size_ = 0
protected

Definition at line 272 of file free-list.h.

◆ number_of_categories_

const int v8::internal::FreeList::number_of_categories_ = 0
protected

Definition at line 270 of file free-list.h.

◆ wasted_bytes_

std::atomic<size_t> v8::internal::FreeList::wasted_bytes_ = 0
protected

Definition at line 280 of file free-list.h.


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