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

#include <heap-object-header.h>

Inheritance diagram for cppgc::internal::HeapObjectHeader:
Collaboration diagram for cppgc::internal::HeapObjectHeader:

Public Member Functions

 HeapObjectHeader (size_t size, GCInfoIndex gc_info_index)
 
Address ObjectStart () const
 
template<AccessMode mode = AccessMode::kNonAtomic>
Address ObjectEnd () const
 
template<AccessMode mode = AccessMode::kNonAtomic>
GCInfoIndex GetGCInfoIndex () const
 
template<AccessMode mode = AccessMode::kNonAtomic>
size_t AllocatedSize () const
 
void SetAllocatedSize (size_t size)
 
template<AccessMode mode = AccessMode::kNonAtomic>
size_t ObjectSize () const
 
template<AccessMode mode = AccessMode::kNonAtomic>
bool IsLargeObject () const
 
template<AccessMode = AccessMode::kNonAtomic>
bool IsInConstruction () const
 
V8_EXPORT_PRIVATE void MarkAsFullyConstructed ()
 
template<AccessMode = AccessMode::kNonAtomic>
bool IsMarked () const
 
template<AccessMode = AccessMode::kNonAtomic>
void Unmark ()
 
bool TryMarkAtomic ()
 
void MarkNonAtomic ()
 
template<AccessMode = AccessMode::kNonAtomic>
bool IsYoung () const
 
template<AccessMode = AccessMode::kNonAtomic>
bool IsFree () const
 
bool IsFinalizable () const
 
void Finalize ()
 
V8_EXPORT_PRIVATE HeapObjectName GetName () const
 
V8_EXPORT_PRIVATE HeapObjectName GetName (HeapObjectNameForUnnamedObject) const
 
template<AccessMode = AccessMode::kNonAtomic>
void TraceImpl (Visitor *) const
 

Static Public Member Functions

static HeapObjectHeaderFromObject (void *address)
 
static const HeapObjectHeaderFromObject (const void *address)
 

Static Public Attributes

static constexpr size_t kSizeLog2 = 17
 
static constexpr size_t kMaxSize = (size_t{1} << kSizeLog2) - 1
 
static constexpr uint16_t kLargeObjectSizeInHeader = 0
 

Private Types

enum class  EncodedHalf : uint8_t { kLow , kHigh }
 
using FullyConstructedField = v8::base::BitField16<bool, 0, 1>
 
using UnusedField1 = FullyConstructedField::Next<bool, 1>
 
using GCInfoIndexField = UnusedField1::Next<GCInfoIndex, 14>
 
using MarkBitField = v8::base::BitField16<bool, 0, 1>
 
using SizeField
 

Private Member Functions

V8_EXPORT_PRIVATE void CheckApiConstants ()
 
template<AccessMode , EncodedHalf part, std::memory_order memory_order = std::memory_order_seq_cst>
uint16_t LoadEncoded () const
 
template<AccessMode mode, EncodedHalf part, std::memory_order memory_order = std::memory_order_seq_cst>
void StoreEncoded (uint16_t bits, uint16_t mask)
 

Static Private Member Functions

static constexpr size_t DecodeSize (uint16_t encoded)
 
static constexpr uint16_t EncodeSize (size_t size)
 

Private Attributes

uint16_t encoded_high_
 
uint16_t encoded_low_
 

Detailed Description

Definition at line 58 of file heap-object-header.h.

Member Typedef Documentation

◆ FullyConstructedField

◆ GCInfoIndexField

◆ MarkBitField

Definition at line 133 of file heap-object-header.h.

◆ SizeField

Initial value:
BitField< T2, kShift+kSize, size2, U > Next
Definition bit-field.h:47

Definition at line 134 of file heap-object-header.h.

◆ UnusedField1

Member Enumeration Documentation

◆ EncodedHalf

enum class cppgc::internal::HeapObjectHeader::EncodedHalf : uint8_t
strongprivate
Enumerator
kLow 
kHigh 

Definition at line 126 of file heap-object-header.h.

Constructor & Destructor Documentation

◆ HeapObjectHeader()

cppgc::internal::HeapObjectHeader::HeapObjectHeader ( size_t size,
GCInfoIndex gc_info_index )
inline

Definition at line 185 of file heap-object-header.h.

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

Member Function Documentation

◆ AllocatedSize()

template<AccessMode mode>
size_t cppgc::internal::HeapObjectHeader::AllocatedSize ( ) const
inline

Definition at line 228 of file heap-object-header.h.

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

◆ CheckApiConstants()

void cppgc::internal::HeapObjectHeader::CheckApiConstants ( )
private

Definition at line 20 of file heap-object-header.cc.

Here is the caller graph for this function:

◆ DecodeSize()

static constexpr size_t cppgc::internal::HeapObjectHeader::DecodeSize ( uint16_t encoded)
inlinestaticconstexprprivate

Definition at line 137 of file heap-object-header.h.

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

◆ EncodeSize()

static constexpr uint16_t cppgc::internal::HeapObjectHeader::EncodeSize ( size_t size)
inlinestaticconstexprprivate

Definition at line 142 of file heap-object-header.h.

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

◆ Finalize()

void cppgc::internal::HeapObjectHeader::Finalize ( )

Definition at line 27 of file heap-object-header.cc.

Here is the call graph for this function:

◆ FromObject() [1/2]

const HeapObjectHeader & cppgc::internal::HeapObjectHeader::FromObject ( const void * address)
inlinestatic

Definition at line 180 of file heap-object-header.h.

Here is the call graph for this function:

◆ FromObject() [2/2]

HeapObjectHeader & cppgc::internal::HeapObjectHeader::FromObject ( void * address)
inlinestatic

Definition at line 174 of file heap-object-header.h.

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

◆ GetGCInfoIndex()

template<AccessMode mode>
GCInfoIndex cppgc::internal::HeapObjectHeader::GetGCInfoIndex ( ) const
inline

Definition at line 221 of file heap-object-header.h.

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

◆ GetName() [1/2]

HeapObjectName cppgc::internal::HeapObjectHeader::GetName ( ) const

Definition at line 41 of file heap-object-header.cc.

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

◆ GetName() [2/2]

HeapObjectName cppgc::internal::HeapObjectHeader::GetName ( HeapObjectNameForUnnamedObject heap_object_name) const

Definition at line 45 of file heap-object-header.cc.

Here is the call graph for this function:

◆ IsFinalizable()

bool cppgc::internal::HeapObjectHeader::IsFinalizable ( ) const
inline

Definition at line 309 of file heap-object-header.h.

Here is the call graph for this function:

◆ IsFree()

template<AccessMode mode>
bool cppgc::internal::HeapObjectHeader::IsFree ( ) const

Definition at line 305 of file heap-object-header.h.

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

◆ IsInConstruction()

template<AccessMode mode>
bool cppgc::internal::HeapObjectHeader::IsInConstruction ( ) const

Definition at line 263 of file heap-object-header.h.

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

◆ IsLargeObject()

template<AccessMode mode>
bool cppgc::internal::HeapObjectHeader::IsLargeObject ( ) const
inline

Definition at line 258 of file heap-object-header.h.

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

◆ IsMarked()

template<AccessMode mode>
bool cppgc::internal::HeapObjectHeader::IsMarked ( ) const

Definition at line 270 of file heap-object-header.h.

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

◆ IsYoung()

template<AccessMode mode>
bool cppgc::internal::HeapObjectHeader::IsYoung ( ) const

Definition at line 300 of file heap-object-header.h.

Here is the call graph for this function:

◆ LoadEncoded()

template<AccessMode mode, HeapObjectHeader::EncodedHalf part, std::memory_order memory_order>
uint16_t cppgc::internal::HeapObjectHeader::LoadEncoded ( ) const
inlineprivate

Definition at line 351 of file heap-object-header.h.

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

◆ MarkAsFullyConstructed()

void cppgc::internal::HeapObjectHeader::MarkAsFullyConstructed ( )

Definition at line 51 of file heap-object-header.cc.

Here is the call graph for this function:

◆ MarkNonAtomic()

void cppgc::internal::HeapObjectHeader::MarkNonAtomic ( )
inline

Definition at line 294 of file heap-object-header.h.

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

◆ ObjectEnd()

template<AccessMode mode>
Address cppgc::internal::HeapObjectHeader::ObjectEnd ( ) const
inline

Definition at line 214 of file heap-object-header.h.

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

◆ ObjectSize()

template<AccessMode mode>
size_t cppgc::internal::HeapObjectHeader::ObjectSize ( ) const
inline

Definition at line 251 of file heap-object-header.h.

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

◆ ObjectStart()

Address cppgc::internal::HeapObjectHeader::ObjectStart ( ) const
inline

Definition at line 208 of file heap-object-header.h.

Here is the caller graph for this function:

◆ SetAllocatedSize()

void cppgc::internal::HeapObjectHeader::SetAllocatedSize ( size_t size)
inline

Definition at line 237 of file heap-object-header.h.

Here is the call graph for this function:

◆ StoreEncoded()

template<AccessMode mode, HeapObjectHeader::EncodedHalf part, std::memory_order memory_order>
void cppgc::internal::HeapObjectHeader::StoreEncoded ( uint16_t bits,
uint16_t mask )
inlineprivate

Definition at line 360 of file heap-object-header.h.

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

◆ TraceImpl()

template<AccessMode mode>
void cppgc::internal::HeapObjectHeader::TraceImpl ( Visitor * visitor) const

Definition at line 343 of file heap-object-header.h.

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

◆ TryMarkAtomic()

bool cppgc::internal::HeapObjectHeader::TryMarkAtomic ( )
inline

Definition at line 283 of file heap-object-header.h.

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

◆ Unmark()

template<AccessMode mode>
void cppgc::internal::HeapObjectHeader::Unmark ( )

Definition at line 277 of file heap-object-header.h.

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

Member Data Documentation

◆ encoded_high_

uint16_t cppgc::internal::HeapObjectHeader::encoded_high_
private

Definition at line 165 of file heap-object-header.h.

◆ encoded_low_

uint16_t cppgc::internal::HeapObjectHeader::encoded_low_
private

Definition at line 166 of file heap-object-header.h.

◆ kLargeObjectSizeInHeader

uint16_t cppgc::internal::HeapObjectHeader::kLargeObjectSizeInHeader = 0
staticconstexpr

Definition at line 62 of file heap-object-header.h.

◆ kMaxSize

size_t cppgc::internal::HeapObjectHeader::kMaxSize = (size_t{1} << kSizeLog2) - 1
staticconstexpr

Definition at line 61 of file heap-object-header.h.

◆ kSizeLog2

size_t cppgc::internal::HeapObjectHeader::kSizeLog2 = 17
staticconstexpr

Definition at line 60 of file heap-object-header.h.


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