v8  9.0.257(node16.0.0)
V8 is Google's open source JavaScript engine
JSHeapConsistency Class Referencefinal

#include <v8-cppgc.h>

Public Types

using WriteBarrierParams = cppgc::internal::WriteBarrier::Params
 
using WriteBarrierType = cppgc::internal::WriteBarrier::Type
 

Static Public Member Functions

template<typename HeapHandleCallback >
static V8_INLINE WriteBarrierType GetWriteBarrierType (const TracedReferenceBase &ref, WriteBarrierParams &params, HeapHandleCallback callback)
 
template<typename HeapHandleCallback >
static V8_INLINE WriteBarrierType GetWriteBarrierType (v8::Local< v8::Object > &wrapper, int wrapper_index, const void *wrappable, WriteBarrierParams &params, HeapHandleCallback callback)
 
static V8_INLINE void DijkstraMarkingBarrier (const WriteBarrierParams &params, cppgc::HeapHandle &heap_handle, const TracedReferenceBase &ref)
 
static V8_INLINE void DijkstraMarkingBarrier (const WriteBarrierParams &params, cppgc::HeapHandle &heap_handle, const void *object)
 
static V8_INLINE void GenerationalBarrier (const WriteBarrierParams &params, const TracedReferenceBase &ref)
 

Detailed Description

DO NOT USE: Use the appropriate managed types.

Consistency helpers that aid in maintaining a consistent internal state of the garbage collector.

Definition at line 148 of file v8-cppgc.h.

Member Typedef Documentation

◆ WriteBarrierParams

◆ WriteBarrierType

Member Function Documentation

◆ DijkstraMarkingBarrier() [1/2]

static V8_INLINE void DijkstraMarkingBarrier ( const WriteBarrierParams params,
cppgc::HeapHandle &  heap_handle,
const TracedReferenceBase ref 
)
inlinestatic

Conservative Dijkstra-style write barrier that processes an object if it has not yet been processed.

Parameters
paramsThe parameters retrieved from GetWriteBarrierType().
refThe reference being written to.

Definition at line 224 of file v8-cppgc.h.

References WriteBarrier::CheckParams(), and WriteBarrier::kMarking.

◆ DijkstraMarkingBarrier() [2/2]

static V8_INLINE void DijkstraMarkingBarrier ( const WriteBarrierParams params,
cppgc::HeapHandle &  heap_handle,
const void *  object 
)
inlinestatic

Conservative Dijkstra-style write barrier that processes an object if it has not yet been processed.

Parameters
paramsThe parameters retrieved from GetWriteBarrierType().
objectThe pointer to the object. May be an interior pointer to a an interface of the actual object.

Definition at line 240 of file v8-cppgc.h.

References WriteBarrier::DijkstraMarkingBarrier().

◆ GenerationalBarrier()

static V8_INLINE void GenerationalBarrier ( const WriteBarrierParams params,
const TracedReferenceBase ref 
)
inlinestatic

Generational barrier for maintaining consistency when running with multiple generations.

Parameters
paramsThe parameters retrieved from GetWriteBarrierType().
refThe reference being written to.

Definition at line 253 of file v8-cppgc.h.

◆ GetWriteBarrierType() [1/2]

static V8_INLINE WriteBarrierType GetWriteBarrierType ( const TracedReferenceBase ref,
WriteBarrierParams params,
HeapHandleCallback  callback 
)
inlinestatic

Gets the required write barrier type for a specific write.

Note: Handling for C++ to JS references.

Parameters
refThe reference being written to.
paramsParameters that may be used for actual write barrier calls. Only filled if return value indicates that a write barrier is needed. The contents of the params are an implementation detail.
callbackCallback returning the corresponding heap handle. The callback is only invoked if the heap cannot otherwise be figured out. The callback must not allocate.
Returns
whether a write barrier is needed and which barrier to invoke.

Definition at line 169 of file v8-cppgc.h.

References WriteBarrier::Params::heap, WriteBarrier::IsAnyIncrementalOrConcurrentMarking(), TracedReferenceBase::IsEmpty(), HeapState::IsMarking(), WriteBarrier::kMarking, and WriteBarrier::kNone.

◆ GetWriteBarrierType() [2/2]

static V8_INLINE WriteBarrierType GetWriteBarrierType ( v8::Local< v8::Object > &  wrapper,
int  wrapper_index,
const void *  wrappable,
WriteBarrierParams params,
HeapHandleCallback  callback 
)
inlinestatic

Gets the required write barrier type for a specific write.

Note: Handling for JS to C++ references.

Parameters
wrapperThe wrapper that has been written into.
wrapper_indexThe wrapper index in wrapper that has been written into.
wrappableThe value that was written.
paramsParameters that may be used for actual write barrier calls. Only filled if return value indicates that a write barrier is needed. The contents of the params are an implementation detail.
callbackCallback returning the corresponding heap handle. The callback is only invoked if the heap cannot otherwise be figured out. The callback must not allocate.
Returns
whether a write barrier is needed and which barrier to invoke.

Definition at line 206 of file v8-cppgc.h.


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