v8  9.4.146 (node 16.15.0)
V8 is Google's open source JavaScript engine
WrapperDescriptor Struct Referencefinal

#include <v8-cppgc.h>

Public Types

using InternalFieldIndex = int

Public Member Functions

constexpr WrapperDescriptor (InternalFieldIndex wrappable_type_index, InternalFieldIndex wrappable_instance_index, uint16_t embedder_id_for_garbage_collected)

Data Fields

InternalFieldIndex wrappable_type_index
InternalFieldIndex wrappable_instance_index
uint16_t embedder_id_for_garbage_collected

Static Public Attributes

static constexpr uint16_t kUnknownEmbedderId = UINT16_MAX

Detailed Description

Describes how V8 wrapper objects maintain references to garbage-collected C++ objects.

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

Member Typedef Documentation

◆ InternalFieldIndex

using InternalFieldIndex = int

The index used on v8::Ojbect::SetAlignedPointerFromInternalField() and related APIs to add additional data to an object which is used to identify JS->C++ references.

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

Constructor & Destructor Documentation

◆ WrapperDescriptor()

constexpr WrapperDescriptor ( InternalFieldIndex  wrappable_type_index,
InternalFieldIndex  wrappable_instance_index,
uint16_t  embedder_id_for_garbage_collected 

Field Documentation

◆ embedder_id_for_garbage_collected

uint16_t embedder_id_for_garbage_collected

Embedder id identifying instances of garbage-collected objects. It is expected that the first field of the wrappable type is a uint16_t holding the id. Only references to instances of wrappables types with an id of embedder_id_for_garbage_collected will be considered by CppHeap.

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

Referenced by WrapperDescriptor::WrapperDescriptor().

◆ kUnknownEmbedderId

constexpr uint16_t kUnknownEmbedderId = UINT16_MAX

Unknown embedder id. The value is reserved for internal usages and must not be used with CppHeap.

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

◆ wrappable_instance_index

InternalFieldIndex wrappable_instance_index

Index of the wrappable instance.

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

Referenced by WrapperDescriptor::WrapperDescriptor().

◆ wrappable_type_index

InternalFieldIndex wrappable_type_index

Index of the wrappable type.

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

Referenced by WrapperDescriptor::WrapperDescriptor().

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