v8  8.4.371 (node 14.15.5)
V8 is Google's open source JavaScript engine
cppgc Namespace Reference

Namespaces

 internal
 

Data Structures

class  MakeGarbageCollectedTraitBase
 
class  MakeGarbageCollectedTrait
 
struct  PostConstructionCallbackTrait
 
struct  CustomSpaceIndex
 
class  CustomSpaceBase
 
class  CustomSpace
 
struct  SpaceTrait
 
class  GarbageCollected
 
class  GarbageCollectedMixin
 
class  Heap
 
class  LivenessBroker
 
class  SourceLocation
 
struct  TraceDescriptor
 
struct  TraceTrait
 
class  Visitor
 

Typedefs

template<typename T >
using Member = internal::BasicMember< T, internal::StrongMemberTag, internal::DijkstraWriteBarrierPolicy >
 
template<typename T >
using WeakMember = internal::BasicMember< T, internal::WeakMemberTag, internal::DijkstraWriteBarrierPolicy >
 
template<typename T >
using UntracedMember = internal::BasicMember< T, internal::UntracedMemberTag, internal::NoWriteBarrierPolicy >
 
template<typename T >
using Persistent = internal::BasicPersistent< T, internal::StrongPersistentPolicy >
 
template<typename T >
using WeakPersistent = internal::BasicPersistent< T, internal::WeakPersistentPolicy >
 
using PageAllocator = v8::PageAllocator
 
using TraceCallback = void(*)(Visitor *, const void *)
 
using WeakCallback = void(*)(const LivenessBroker &, const void *)
 

Enumerations

enum class  EmbedderStackState {
  kMayContainHeapPointers , kNoHeapPointers , V8_ENUM_DEPRECATE_SOON , V8_ENUM_DEPRECATE_SOON ,
  V8_ENUM_DEPRECATE_SOON =("Use kNoHeapPointers") = kNoHeapPointers
}
 

Functions

template<typename T , typename... Args>
T * MakeGarbageCollected (Heap *heap, Args &&... args)
 
V8_EXPORT void InitializePlatform (PageAllocator *page_allocator)
 
V8_EXPORT void ShutdownPlatform ()
 

Variables

constexpr internal::SentinelPointer kSentinelPointer
 
template<typename T >
constexpr bool IsWeakV = internal::IsWeak<T>::value
 

Typedef Documentation

◆ Member

using Member = internal::BasicMember<T, internal::StrongMemberTag, internal::DijkstraWriteBarrierPolicy>

Members are used in classes to contain strong pointers to other garbage collected objects. All Member fields of a class must be traced in the class' trace method.

Definition at line 179 of file member.h.

◆ PageAllocator

Definition at line 15 of file platform.h.

◆ Persistent

Persistent is a way to create a strong pointer from an off-heap object to another on-heap object. As long as the Persistent handle is alive the GC will keep the object pointed to alive. The Persistent handle is always a GC root from the point of view of the GC. Persistent must be constructed and destructed in the same thread.

Definition at line 289 of file persistent.h.

◆ TraceCallback

using TraceCallback = void (*)(Visitor*, const void*)

Definition at line 24 of file trace-trait.h.

◆ UntracedMember

using UntracedMember = internal::BasicMember<T, internal::UntracedMemberTag, internal::NoWriteBarrierPolicy>

UntracedMember is a pointer to an on-heap object that is not traced for some reason. Do not use this unless you know what you are doing. Keeping raw pointers to on-heap objects is prohibited unless used from stack. Pointee must be kept alive through other means.

Definition at line 201 of file member.h.

◆ WeakCallback

using WeakCallback = void (*)(const LivenessBroker&, const void*)

Definition at line 21 of file visitor.h.

◆ WeakMember

WeakMember is similar to Member in that it is used to point to other garbage collected objects. However instead of creating a strong pointer to the object, the WeakMember creates a weak pointer, which does not keep the pointee alive. Hence if all pointers to to a heap allocated object are weak the object will be garbage collected. At the time of GC the weak pointers will automatically be set to null.

Definition at line 191 of file member.h.

◆ WeakPersistent

WeakPersistent is a way to create a weak pointer from an off-heap object to an on-heap object. The pointer is automatically cleared when the pointee gets collected. WeakPersistent must be constructed and destructed in the same thread.

Definition at line 299 of file persistent.h.

Enumeration Type Documentation

◆ EmbedderStackState

enum EmbedderStackState
strong
Enumerator
kMayContainHeapPointers 
kNoHeapPointers 
V8_ENUM_DEPRECATE_SOON 
V8_ENUM_DEPRECATE_SOON 
V8_ENUM_DEPRECATE_SOON 

Definition at line 14 of file common.h.

Function Documentation

◆ InitializePlatform()

V8_EXPORT void cppgc::InitializePlatform ( PageAllocator page_allocator)

◆ MakeGarbageCollected()

T* cppgc::MakeGarbageCollected ( Heap heap,
Args &&...  args 
)

Constructs a managed object of type T where T transitively inherits from GarbageCollected.

Parameters
argsList of arguments with which an instance of T will be constructed.
Returns
an instance of type T.

Definition at line 152 of file allocation.h.

◆ ShutdownPlatform()

V8_EXPORT void cppgc::ShutdownPlatform ( )

Variable Documentation

◆ IsWeakV

constexpr bool IsWeakV = internal::IsWeak<T>::value
constexpr

Definition at line 105 of file type-traits.h.

◆ kSentinelPointer

constexpr internal::SentinelPointer kSentinelPointer
constexpr

Definition at line 129 of file pointer-policies.h.

Referenced by LivenessBroker::IsHeapObjectAlive(), and Visitor::Trace().