v8  8.1.307(node14.1.0)
V8 is Google's open source JavaScript engine
TracedReference< T > Class Template Reference

#include <v8.h>

Inheritance diagram for TracedReference< T >:
Collaboration diagram for TracedReference< T >:

Public Member Functions

 TracedReference ()
 
template<class S >
 TracedReference (Isolate *isolate, Local< S > that)
 
V8_INLINE TracedReference (TracedReference &&other)
 
template<typename S >
V8_INLINE TracedReference (TracedReference< S > &&other)
 
V8_INLINE TracedReference (const TracedReference &other)
 
template<typename S >
V8_INLINE TracedReference (const TracedReference< S > &other)
 
V8_INLINE TracedReferenceoperator= (TracedReference &&rhs)
 
template<class S >
V8_INLINE TracedReferenceoperator= (TracedReference< S > &&rhs)
 
V8_INLINE TracedReferenceoperator= (const TracedReference &rhs)
 
template<class S >
V8_INLINE TracedReferenceoperator= (const TracedReference< S > &rhs)
 
template<class S >
V8_INLINE void Reset (Isolate *isolate, const Local< S > &other)
 
template<class S >
V8_INLINE TracedReference< S > & As () const
 
V8_INLINE void SetFinalizationCallback (void *parameter, WeakCallbackInfo< void >::Callback callback)
 
template<class S >
void Reset (Isolate *isolate, const Local< S > &other)
 
template<class S >
TracedReference< T > & operator= (TracedReference< S > &&rhs)
 
template<class S >
TracedReference< T > & operator= (const TracedReference< S > &rhs)
 
- Public Member Functions inherited from TracedReferenceBase< T >
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
 

Detailed Description

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

A traced handle without destructor that clears the handle. The embedder needs to ensure that the handle is not accessed once the V8 object has been reclaimed. This can happen when the handle is not passed through the EmbedderHeapTracer. For more details see TracedReferenceBase.

The reference assumes the embedder has precise knowledge about references at all times. In case V8 needs to separately handle on-stack references, the embedder is required to set the stack start through |EmbedderHeapTracer::SetStackStart|.

Definition at line 101 of file v8.h.

Constructor & Destructor Documentation

◆ TracedReference() [1/6]

TracedReference ( )
inline

An empty TracedReference without storage cell.

Definition at line 1065 of file v8.h.

References V8::TracedReferenceBase.

◆ TracedReference() [2/6]

TracedReference ( Isolate isolate,
Local< S >  that 
)
inline

Construct a TracedReference from a Local.

When the Local is non-empty, a new storage cell is created pointing to the same object.

Definition at line 1074 of file v8.h.

References V8::TracedReferenceBase.

◆ TracedReference() [3/6]

V8_INLINE TracedReference ( TracedReference< T > &&  other)
inline

Move constructor initializing TracedReference from an existing one.

Definition at line 1084 of file v8.h.

◆ TracedReference() [4/6]

V8_INLINE TracedReference ( TracedReference< S > &&  other)
inline

Move constructor initializing TracedReference from an existing one.

Definition at line 1094 of file v8.h.

◆ TracedReference() [5/6]

V8_INLINE TracedReference ( const TracedReference< T > &  other)
inline

Copy constructor initializing TracedReference from an existing one.

Definition at line 1103 of file v8.h.

◆ TracedReference() [6/6]

V8_INLINE TracedReference ( const TracedReference< S > &  other)
inline

Copy constructor initializing TracedReference from an existing one.

Definition at line 1113 of file v8.h.

Member Function Documentation

◆ As()

V8_INLINE TracedReference<S>& As ( ) const
inline

Definition at line 1154 of file v8.h.

References V8::TracedReference.

◆ operator=() [1/6]

TracedReference< T > & operator= ( TracedReference< T > &&  rhs)

Move assignment operator initializing TracedGlobal from an existing one.

Definition at line 10893 of file v8.h.

◆ operator=() [2/6]

V8_INLINE TracedReference& operator= ( TracedReference< S > &&  rhs)

Move assignment operator initializing TracedGlobal from an existing one.

◆ operator=() [3/6]

TracedReference< T > & operator= ( const TracedReference< T > &  rhs)

Copy assignment operator initializing TracedGlobal from an existing one.

Note: Prohibited when |other| has a finalization callback set through |SetFinalizationCallback|.

Definition at line 10903 of file v8.h.

◆ operator=() [4/6]

V8_INLINE TracedReference& operator= ( const TracedReference< S > &  rhs)

Copy assignment operator initializing TracedGlobal from an existing one.

Note: Prohibited when |other| has a finalization callback set through |SetFinalizationCallback|.

◆ operator=() [5/6]

TracedReference<T>& operator= ( TracedReference< S > &&  rhs)

Definition at line 10877 of file v8.h.

◆ operator=() [6/6]

TracedReference<T>& operator= ( const TracedReference< S > &  rhs)

Definition at line 10885 of file v8.h.

◆ Reset() [1/2]

V8_INLINE void Reset ( Isolate isolate,
const Local< S > &  other 
)

If non-empty, destroy the underlying storage cell and create a new one with the contents of other if other is non empty

◆ Reset() [2/2]

void Reset ( Isolate isolate,
const Local< S > &  other 
)

Definition at line 10867 of file v8.h.

References V8::TracedReferenceBase.

◆ SetFinalizationCallback()

void SetFinalizationCallback ( void *  parameter,
WeakCallbackInfo< void >::Callback  callback 
)

Adds a finalization callback to the handle. The type of this callback is similar to WeakCallbackType::kInternalFields, i.e., it will pass the parameter and the first two internal fields of the object.

The callback is then supposed to reset the handle in the callback. No further V8 API may be called in this callback. In case additional work involving V8 needs to be done, a second callback can be scheduled using WeakCallbackInfo<void>::SetSecondPassCallback.

Definition at line 10941 of file v8.h.


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