v8  8.6.395 (node 15.0.1)
V8 is Google's open source JavaScript engine
TracedReferenceBase< T > Class Template Reference

#include <v8.h>

Inheritance diagram for TracedReferenceBase< T >:

Public Member Functions

bool IsEmpty () const
 
V8_INLINE void Reset ()
 
Local< T > Get (Isolate *isolate) const
 
template<class S >
V8_INLINE bool operator== (const TracedReferenceBase< S > &that) const
 
template<class S >
V8_INLINE bool operator== (const Local< S > &that) const
 
template<class S >
V8_INLINE bool operator!= (const TracedReferenceBase< S > &that) const
 
template<class S >
V8_INLINE bool operator!= (const Local< S > &that) const
 
V8_INLINE void SetWrapperClassId (uint16_t class_id)
 
V8_INLINE uint16_t WrapperClassId () const
 
template<class S >
V8_INLINE TracedReferenceBase< S > & As () const
 

Protected Member Functions

void SetSlotThreadSafe (T *new_val)
 
const T * GetSlotThreadSafe () const
 

Friends

class EmbedderHeapTracer
 
template<typename F >
class Local
 
class Object
 
template<typename F >
class TracedGlobal
 
template<typename F >
class TracedReference
 
template<typename F >
class ReturnValue
 

Detailed Description

template<typename T>
class v8::TracedReferenceBase< T >

A traced handle with copy and move semantics. The handle is to be used together with |v8::EmbedderHeapTracer| and specifies edges from the embedder into V8's heap.

The exact semantics are:

  • Tracing garbage collections use |v8::EmbedderHeapTracer|.
  • Non-tracing garbage collections refer to |v8::EmbedderHeapTracer::IsRootForNonTracingGC()| whether the handle should be treated as root or not.

Note that the base class cannot be instantiated itself. Choose from

Definition at line 843 of file v8.h.

Member Function Documentation

◆ As()

V8_INLINE TracedReferenceBase<S>& As ( ) const
inline

Definition at line 902 of file v8.h.

References Local< T >::TracedReferenceBase.

◆ Get()

Local<T> Get ( Isolate isolate) const
inline

Construct a Local<T> from this handle.

Definition at line 860 of file v8.h.

References Local< T >::Local.

◆ GetSlotThreadSafe()

const T* GetSlotThreadSafe ( ) const
inlineprotected

Get this reference in a thread-safe way

Definition at line 919 of file v8.h.

◆ IsEmpty()

bool IsEmpty ( ) const
inline

Returns true if this TracedReferenceBase is empty, i.e., has not been assigned an object.

Definition at line 849 of file v8.h.

Referenced by TracedReferenceBase< T >::Reset(), TracedReferenceBase< T >::SetWrapperClassId(), and TracedReferenceBase< T >::WrapperClassId().

◆ operator!=() [1/2]

V8_INLINE bool operator!= ( const Local< S > &  that) const
inline

Definition at line 886 of file v8.h.

◆ operator!=() [2/2]

V8_INLINE bool operator!= ( const TracedReferenceBase< S > &  that) const
inline

Definition at line 881 of file v8.h.

◆ operator==() [1/2]

V8_INLINE bool operator== ( const Local< S > &  that) const
inline

Definition at line 872 of file v8.h.

◆ operator==() [2/2]

V8_INLINE bool operator== ( const TracedReferenceBase< S > &  that) const
inline

Definition at line 863 of file v8.h.

◆ Reset()

void Reset

If non-empty, destroy the underlying storage cell. |IsEmpty| will return true after this call.

Definition at line 10960 of file v8.h.

References TracedReferenceBase< T >::IsEmpty(), and TracedReferenceBase< T >::SetSlotThreadSafe().

◆ SetSlotThreadSafe()

void SetSlotThreadSafe ( T *  new_val)
inlineprotected

Update this reference in a thread-safe way

Definition at line 911 of file v8.h.

Referenced by TracedReferenceBase< T >::Reset().

◆ SetWrapperClassId()

void SetWrapperClassId ( uint16_t  class_id)

Assigns a wrapper class ID to the handle.

Definition at line 11067 of file v8.h.

References TracedReferenceBase< T >::IsEmpty(), and Internals::kNodeClassIdOffset.

◆ WrapperClassId()

uint16_t WrapperClassId

Returns the class ID previously assigned to this handle or 0 if no class ID was previously assigned.

Definition at line 11076 of file v8.h.

References TracedReferenceBase< T >::IsEmpty(), and Internals::kNodeClassIdOffset.

Friends And Related Function Documentation

◆ EmbedderHeapTracer

friend class EmbedderHeapTracer
friend

Definition at line 937 of file v8.h.

◆ Local

friend class Local
friend

Definition at line 939 of file v8.h.

◆ Object

friend class Object
friend

Definition at line 940 of file v8.h.

◆ ReturnValue

friend class ReturnValue
friend

Definition at line 946 of file v8.h.

◆ TracedGlobal

friend class TracedGlobal
friend

Definition at line 942 of file v8.h.

◆ TracedReference

friend class TracedReference
friend

Definition at line 944 of file v8.h.


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