v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
heap::base::BasicSlotSet< SlotGranularity > Class Template Reference

#include <basic-slot-set.h>

Collaboration diagram for heap::base::BasicSlotSet< SlotGranularity >:

Classes

class  Bucket
 

Public Types

enum  AccessMode : uint8_t { ATOMIC , NON_ATOMIC }
 
enum  EmptyBucketMode { FREE_EMPTY_BUCKETS , KEEP_EMPTY_BUCKETS }
 
using Address = uintptr_t
 

Public Member Functions

 BasicSlotSet ()=delete
 
template<AccessMode access_mode>
void Insert (size_t slot_offset)
 
bool Contains (size_t slot_offset)
 
void Remove (size_t slot_offset)
 
void RemoveRange (size_t start_offset, size_t end_offset, size_t buckets, EmptyBucketMode mode)
 
bool Lookup (size_t slot_offset)
 
template<AccessMode access_mode = AccessMode::ATOMIC, typename Callback >
size_t Iterate (Address chunk_start, size_t start_bucket, size_t end_bucket, Callback callback, EmptyBucketMode mode)
 
size_t num_buckets () const
 

Static Public Member Functions

static BasicSlotSetAllocate (size_t buckets)
 
static void Delete (BasicSlotSet *slot_set)
 
static constexpr size_t BucketsForSize (size_t size)
 
static constexpr size_t BucketForSlot (size_t slot_offset)
 
static constexpr size_t OffsetForBucket (size_t bucket_index)
 

Static Public Attributes

static constexpr int kCellsPerBucket = 32
 
static constexpr int kCellsPerBucketLog2 = 5
 
static constexpr int kCellSizeBytesLog2 = 2
 
static constexpr int kCellSizeBytes = 1 << kCellSizeBytesLog2
 
static constexpr int kBitsPerCell = 32
 
static constexpr int kBitsPerCellLog2 = 5
 
static constexpr int kBitsPerBucket = kCellsPerBucket * kBitsPerCell
 
static constexpr int kBitsPerBucketLog2
 

Protected Member Functions

template<AccessMode access_mode = AccessMode::ATOMIC, typename Callback , typename EmptyBucketCallback >
size_t Iterate (Address chunk_start, size_t start_bucket, size_t end_bucket, Callback callback, EmptyBucketCallback empty_bucket_callback)
 
bool FreeBucketIfEmpty (size_t bucket_index)
 
void ClearBucket (Bucket *bucket, int start_cell, int end_cell)
 
template<AccessMode access_mode = AccessMode::ATOMIC>
void ReleaseBucket (size_t bucket_index)
 
template<AccessMode access_mode = AccessMode::ATOMIC>
BucketLoadBucket (Bucket **bucket)
 
template<AccessMode access_mode = AccessMode::ATOMIC>
BucketLoadBucket (size_t bucket_index)
 
template<AccessMode access_mode = AccessMode::ATOMIC>
void StoreBucket (Bucket **bucket, Bucket *value)
 
template<AccessMode access_mode = AccessMode::ATOMIC>
void StoreBucket (size_t bucket_index, Bucket *value)
 
template<AccessMode access_mode = AccessMode::ATOMIC>
bool SwapInNewBucket (size_t bucket_index, Bucket *value)
 
void SlotToIndices (size_t slot_offset, size_t *bucket_index, int *cell_index, int *bit_index)
 
Bucket ** buckets ()
 
Bucket ** bucket (size_t bucket_index)
 
void set_num_buckets (size_t num_buckets)
 

Static Protected Attributes

static constexpr int kNumBucketsSize = sizeof(size_t)
 

Static Private Attributes

static constexpr auto kSystemPointerSize = sizeof(void*)
 

Friends

class v8::internal::WriteBarrierCodeStubAssembler
 

Detailed Description

template<size_t SlotGranularity>
class heap::base::BasicSlotSet< SlotGranularity >

Definition at line 31 of file basic-slot-set.h.

Member Typedef Documentation

◆ Address

template<size_t SlotGranularity>
using heap::base::BasicSlotSet< SlotGranularity >::Address = uintptr_t

Definition at line 35 of file basic-slot-set.h.

Member Enumeration Documentation

◆ AccessMode

template<size_t SlotGranularity>
enum heap::base::BasicSlotSet::AccessMode : uint8_t
Enumerator
ATOMIC 
NON_ATOMIC 

Definition at line 37 of file basic-slot-set.h.

◆ EmptyBucketMode

template<size_t SlotGranularity>
enum heap::base::BasicSlotSet::EmptyBucketMode
Enumerator
FREE_EMPTY_BUCKETS 
KEEP_EMPTY_BUCKETS 

Definition at line 42 of file basic-slot-set.h.

Constructor & Destructor Documentation

◆ BasicSlotSet()

template<size_t SlotGranularity>
heap::base::BasicSlotSet< SlotGranularity >::BasicSlotSet ( )
delete

Member Function Documentation

◆ Allocate()

template<size_t SlotGranularity>
static BasicSlotSet * heap::base::BasicSlotSet< SlotGranularity >::Allocate ( size_t buckets)
inlinestatic

Definition at line 49 of file basic-slot-set.h.

Here is the call graph for this function:

◆ bucket()

template<size_t SlotGranularity>
Bucket ** heap::base::BasicSlotSet< SlotGranularity >::bucket ( size_t bucket_index)
inlineprotected

Definition at line 465 of file basic-slot-set.h.

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

◆ BucketForSlot()

template<size_t SlotGranularity>
static constexpr size_t heap::base::BasicSlotSet< SlotGranularity >::BucketForSlot ( size_t slot_offset)
inlinestaticconstexpr

Definition at line 95 of file basic-slot-set.h.

Here is the call graph for this function:

◆ buckets()

template<size_t SlotGranularity>
Bucket ** heap::base::BasicSlotSet< SlotGranularity >::buckets ( )
inlineprotected

Definition at line 464 of file basic-slot-set.h.

Here is the caller graph for this function:

◆ BucketsForSize()

template<size_t SlotGranularity>
static constexpr size_t heap::base::BasicSlotSet< SlotGranularity >::BucketsForSize ( size_t size)
inlinestaticconstexpr

Definition at line 89 of file basic-slot-set.h.

◆ ClearBucket()

template<size_t SlotGranularity>
void heap::base::BasicSlotSet< SlotGranularity >::ClearBucket ( Bucket * bucket,
int start_cell,
int end_cell )
inlineprotected

Definition at line 395 of file basic-slot-set.h.

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

◆ Contains()

template<size_t SlotGranularity>
bool heap::base::BasicSlotSet< SlotGranularity >::Contains ( size_t slot_offset)
inline

Definition at line 133 of file basic-slot-set.h.

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

◆ Delete()

template<size_t SlotGranularity>
static void heap::base::BasicSlotSet< SlotGranularity >::Delete ( BasicSlotSet< SlotGranularity > * slot_set)
inlinestatic

Definition at line 77 of file basic-slot-set.h.

Here is the call graph for this function:

◆ FreeBucketIfEmpty()

template<size_t SlotGranularity>
bool heap::base::BasicSlotSet< SlotGranularity >::FreeBucketIfEmpty ( size_t bucket_index)
inlineprotected

Definition at line 382 of file basic-slot-set.h.

Here is the call graph for this function:

◆ Insert()

template<size_t SlotGranularity>
template<AccessMode access_mode>
void heap::base::BasicSlotSet< SlotGranularity >::Insert ( size_t slot_offset)
inline

Definition at line 109 of file basic-slot-set.h.

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

◆ Iterate() [1/2]

template<size_t SlotGranularity>
template<AccessMode access_mode = AccessMode::ATOMIC, typename Callback , typename EmptyBucketCallback >
size_t heap::base::BasicSlotSet< SlotGranularity >::Iterate ( Address chunk_start,
size_t start_bucket,
size_t end_bucket,
Callback callback,
EmptyBucketCallback empty_bucket_callback )
inlineprotected

Definition at line 342 of file basic-slot-set.h.

Here is the call graph for this function:

◆ Iterate() [2/2]

template<size_t SlotGranularity>
template<AccessMode access_mode = AccessMode::ATOMIC, typename Callback >
size_t heap::base::BasicSlotSet< SlotGranularity >::Iterate ( Address chunk_start,
size_t start_bucket,
size_t end_bucket,
Callback callback,
EmptyBucketMode mode )
inline

Definition at line 261 of file basic-slot-set.h.

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

◆ LoadBucket() [1/2]

template<size_t SlotGranularity>
template<AccessMode access_mode = AccessMode::ATOMIC>
Bucket * heap::base::BasicSlotSet< SlotGranularity >::LoadBucket ( Bucket ** bucket)
inlineprotected

Definition at line 413 of file basic-slot-set.h.

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

◆ LoadBucket() [2/2]

template<size_t SlotGranularity>
template<AccessMode access_mode = AccessMode::ATOMIC>
Bucket * heap::base::BasicSlotSet< SlotGranularity >::LoadBucket ( size_t bucket_index)
inlineprotected

Definition at line 420 of file basic-slot-set.h.

Here is the call graph for this function:

◆ Lookup()

template<size_t SlotGranularity>
bool heap::base::BasicSlotSet< SlotGranularity >::Lookup ( size_t slot_offset)
inline

Definition at line 236 of file basic-slot-set.h.

Here is the call graph for this function:

◆ num_buckets()

template<size_t SlotGranularity>
size_t heap::base::BasicSlotSet< SlotGranularity >::num_buckets ( ) const
inline

Definition at line 335 of file basic-slot-set.h.

Here is the caller graph for this function:

◆ OffsetForBucket()

template<size_t SlotGranularity>
static constexpr size_t heap::base::BasicSlotSet< SlotGranularity >::OffsetForBucket ( size_t bucket_index)
inlinestaticconstexpr

Definition at line 101 of file basic-slot-set.h.

◆ ReleaseBucket()

template<size_t SlotGranularity>
template<AccessMode access_mode = AccessMode::ATOMIC>
void heap::base::BasicSlotSet< SlotGranularity >::ReleaseBucket ( size_t bucket_index)
inlineprotected

Definition at line 406 of file basic-slot-set.h.

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

◆ Remove()

template<size_t SlotGranularity>
void heap::base::BasicSlotSet< SlotGranularity >::Remove ( size_t slot_offset)
inline

Definition at line 143 of file basic-slot-set.h.

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

◆ RemoveRange()

template<size_t SlotGranularity>
void heap::base::BasicSlotSet< SlotGranularity >::RemoveRange ( size_t start_offset,
size_t end_offset,
size_t buckets,
EmptyBucketMode mode )
inline

Definition at line 159 of file basic-slot-set.h.

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

◆ set_num_buckets()

template<size_t SlotGranularity>
void heap::base::BasicSlotSet< SlotGranularity >::set_num_buckets ( size_t num_buckets)
inlineprotected

Definition at line 467 of file basic-slot-set.h.

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

◆ SlotToIndices()

template<size_t SlotGranularity>
void heap::base::BasicSlotSet< SlotGranularity >::SlotToIndices ( size_t slot_offset,
size_t * bucket_index,
int * cell_index,
int * bit_index )
inlineprotected

Definition at line 452 of file basic-slot-set.h.

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

◆ StoreBucket() [1/2]

template<size_t SlotGranularity>
template<AccessMode access_mode = AccessMode::ATOMIC>
void heap::base::BasicSlotSet< SlotGranularity >::StoreBucket ( Bucket ** bucket,
Bucket * value )
inlineprotected

Definition at line 425 of file basic-slot-set.h.

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

◆ StoreBucket() [2/2]

template<size_t SlotGranularity>
template<AccessMode access_mode = AccessMode::ATOMIC>
void heap::base::BasicSlotSet< SlotGranularity >::StoreBucket ( size_t bucket_index,
Bucket * value )
inlineprotected

Definition at line 434 of file basic-slot-set.h.

Here is the call graph for this function:

◆ SwapInNewBucket()

template<size_t SlotGranularity>
template<AccessMode access_mode = AccessMode::ATOMIC>
bool heap::base::BasicSlotSet< SlotGranularity >::SwapInNewBucket ( size_t bucket_index,
Bucket * value )
inlineprotected

Definition at line 439 of file basic-slot-set.h.

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

Friends And Related Symbol Documentation

◆ v8::internal::WriteBarrierCodeStubAssembler

template<size_t SlotGranularity>
friend class v8::internal::WriteBarrierCodeStubAssembler
friend

Definition at line 474 of file basic-slot-set.h.

Member Data Documentation

◆ kBitsPerBucket

template<size_t SlotGranularity>
int heap::base::BasicSlotSet< SlotGranularity >::kBitsPerBucket = kCellsPerBucket * kBitsPerCell
staticconstexpr

Definition at line 278 of file basic-slot-set.h.

◆ kBitsPerBucketLog2

template<size_t SlotGranularity>
int heap::base::BasicSlotSet< SlotGranularity >::kBitsPerBucketLog2
staticconstexpr
Initial value:

Definition at line 279 of file basic-slot-set.h.

◆ kBitsPerCell

template<size_t SlotGranularity>
int heap::base::BasicSlotSet< SlotGranularity >::kBitsPerCell = 32
staticconstexpr

Definition at line 276 of file basic-slot-set.h.

◆ kBitsPerCellLog2

template<size_t SlotGranularity>
int heap::base::BasicSlotSet< SlotGranularity >::kBitsPerCellLog2 = 5
staticconstexpr

Definition at line 277 of file basic-slot-set.h.

◆ kCellSizeBytes

template<size_t SlotGranularity>
int heap::base::BasicSlotSet< SlotGranularity >::kCellSizeBytes = 1 << kCellSizeBytesLog2
staticconstexpr

Definition at line 275 of file basic-slot-set.h.

◆ kCellSizeBytesLog2

template<size_t SlotGranularity>
int heap::base::BasicSlotSet< SlotGranularity >::kCellSizeBytesLog2 = 2
staticconstexpr

Definition at line 274 of file basic-slot-set.h.

◆ kCellsPerBucket

template<size_t SlotGranularity>
int heap::base::BasicSlotSet< SlotGranularity >::kCellsPerBucket = 32
staticconstexpr

Definition at line 272 of file basic-slot-set.h.

◆ kCellsPerBucketLog2

template<size_t SlotGranularity>
int heap::base::BasicSlotSet< SlotGranularity >::kCellsPerBucketLog2 = 5
staticconstexpr

Definition at line 273 of file basic-slot-set.h.

◆ kNumBucketsSize

template<size_t SlotGranularity>
int heap::base::BasicSlotSet< SlotGranularity >::kNumBucketsSize = sizeof(size_t)
staticconstexprprotected

Definition at line 471 of file basic-slot-set.h.

◆ kSystemPointerSize

template<size_t SlotGranularity>
auto heap::base::BasicSlotSet< SlotGranularity >::kSystemPointerSize = sizeof(void*)
staticconstexprprivate

Definition at line 32 of file basic-slot-set.h.


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