v8 12.4.254 (node 22.4.1)
V8 is Google's open source JavaScript engine
|
#include <v8-persistent-handle.h>
Public Member Functions | |
V8_INLINE | Persistent ()=default |
template<class S > | |
V8_INLINE | Persistent (Isolate *isolate, Local< S > that) |
template<class S , class M2 > | |
V8_INLINE | Persistent (Isolate *isolate, const Persistent< S, M2 > &that) |
V8_INLINE | Persistent (const Persistent &that) |
template<class S , class M2 > | |
V8_INLINE | Persistent (const Persistent< S, M2 > &that) |
V8_INLINE Persistent & | operator= (const Persistent &that) |
template<class S , class M2 > | |
V8_INLINE Persistent & | operator= (const Persistent< S, M2 > &that) |
V8_INLINE | ~Persistent () |
template<class S , class M2 > | |
V8_INLINE Persistent< S, M2 > & | As () const |
template<class S , class M2 > | |
void | Copy (const Persistent< S, M2 > &that) |
Public Member Functions inherited from PersistentBase< T > | |
V8_INLINE void | Reset () |
template<class S > | |
V8_INLINE void | Reset (Isolate *isolate, const Local< S > &other) |
template<class S > | |
V8_INLINE void | Reset (Isolate *isolate, const PersistentBase< S > &other) |
V8_INLINE Local< T > | Get (Isolate *isolate) const |
template<class S > | |
V8_INLINE bool | operator== (const PersistentBase< S > &that) const |
template<class S > | |
V8_INLINE bool | operator== (const Local< S > &that) const |
template<class S > | |
V8_INLINE bool | operator!= (const PersistentBase< S > &that) const |
template<class S > | |
V8_INLINE bool | operator!= (const Local< S > &that) const |
template<typename P > | |
V8_INLINE void | SetWeak (P *parameter, typename WeakCallbackInfo< P >::Callback callback, WeakCallbackType type) |
V8_INLINE void | SetWeak () |
template<typename P > | |
V8_INLINE P * | ClearWeak () |
V8_INLINE void | ClearWeak () |
V8_INLINE void | AnnotateStrongRetainer (const char *label) |
V8_INLINE bool | IsWeak () const |
V8_INLINE void | SetWrapperClassId (uint16_t class_id) |
V8_INLINE uint16_t | WrapperClassId () const |
PersistentBase (const PersistentBase &other)=delete | |
void | operator= (const PersistentBase &)=delete |
template<class S > | |
void | Reset (Isolate *isolate, const Local< S > &other) |
template<class S > | |
void | Reset (Isolate *isolate, const PersistentBase< S > &other) |
Public Member Functions inherited from IndirectHandleBase | |
V8_INLINE bool | IsEmpty () const |
V8_INLINE void | Clear () |
Static Public Member Functions | |
template<class S , class M2 > | |
static V8_INLINE Persistent< T, M > & | Cast (const Persistent< S, M2 > &that) |
Friends | |
class | Isolate |
class | Utils |
template<class F > | |
class | Local |
template<class F1 , class F2 > | |
class | Persistent |
template<class F > | |
class | ReturnValue |
Additional Inherited Members | |
Protected Member Functions inherited from IndirectHandleBase | |
V8_INLINE | IndirectHandleBase ()=default |
V8_INLINE | IndirectHandleBase (const IndirectHandleBase &other)=default |
V8_INLINE IndirectHandleBase & | operator= (const IndirectHandleBase &that)=default |
V8_INLINE | IndirectHandleBase (internal::Address *location) |
V8_INLINE internal::Address | ptr () const |
V8_INLINE internal::Address *const & | slot () const |
V8_INLINE internal::Address *& | slot () |
template<typename T , bool check_null = false> | |
V8_INLINE T * | value () const |
A PersistentBase which allows copy and assignment.
Copy, assignment and destructor behavior is controlled by the traits class M.
CAVEAT: Persistent objects do not have proper destruction behavior by default and as such will leak the object without explicit clear. Consider using v8::Global
instead which has proper destruction and move semantics.
Definition at line 265 of file v8-persistent-handle.h.
|
default |
A Persistent with no storage cell.
|
inline |
Construct a Persistent from a Local. When the Local is non-empty, a new storage cell is created pointing to the same object, and no flags are set.
Definition at line 278 of file v8-persistent-handle.h.
|
inline |
Construct a Persistent from a Persistent. When the Persistent is non-empty, a new storage cell is created pointing to the same object, and no flags are set.
Definition at line 290 of file v8-persistent-handle.h.
|
inline |
The copy constructors and assignment operator create a Persistent exactly as the Persistent constructor, but the Copy function from the traits class is called, allowing the setting of flags based on the copied Persistent.
Definition at line 302 of file v8-persistent-handle.h.
|
inline |
Definition at line 306 of file v8-persistent-handle.h.
|
inline |
The destructor will dispose the Persistent based on the kResetInDestructor flags in the traits class. Since not calling dispose can result in a memory leak, it is recommended to always set this flag.
Definition at line 324 of file v8-persistent-handle.h.
References PersistentBase< T >::Reset().
|
inline |
Definition at line 342 of file v8-persistent-handle.h.
References Persistent< T, M >::Cast().
|
inlinestatic |
Definition at line 330 of file v8-persistent-handle.h.
References IndirectHandleBase::IsEmpty().
Referenced by Persistent< T, M >::As().
void Copy | ( | const Persistent< S, M2 > & | that | ) |
Definition at line 452 of file v8-persistent-handle.h.
References v8::api_internal::CopyGlobalReference(), IndirectHandleBase::IsEmpty(), and IndirectHandleBase::slot().
|
inline |
Definition at line 309 of file v8-persistent-handle.h.
|
inline |
Definition at line 314 of file v8-persistent-handle.h.
|
friend |
Definition at line 347 of file v8-persistent-handle.h.
Definition at line 350 of file v8-persistent-handle.h.
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 352 of file v8-persistent-handle.h.
Definition at line 354 of file v8-persistent-handle.h.
|
friend |
Definition at line 348 of file v8-persistent-handle.h.