V8: v8::PersistentBase< T > Class Template Reference (original) (raw)
#include <[v8-persistent-handle.h](v8-persistent-handle%5F8h%5Fsource.html)>
| Public Member Functions | |
|---|---|
| void | Reset () |
| template | |
| void | Reset (Isolate *isolate, const Local< S > &other) |
| template | |
| void | Reset (Isolate *isolate, const PersistentBase< S > &other) |
| Local< T > | Get (Isolate *isolate) const |
| template | |
| bool | operator== (const PersistentBase< S > &that) const |
| template | |
| bool | operator== (const Local< S > &that) const |
| template | |
| bool | operator!= (const PersistentBase< S > &that) const |
| template | |
| bool | operator!= (const Local< S > &that) const |
| template | |
| void | SetWeak (P *parameter, typename WeakCallbackInfo< P >::Callback callback, WeakCallbackType type) |
| void | SetWeak () |
| template | |
| P * | ClearWeak () |
| void | ClearWeak () |
| void | AnnotateStrongRetainer (const char *label) |
| bool | IsWeak () const |
| void | SetWrapperClassId (uint16_t class_id) |
| uint16_t | WrapperClassId () const |
| PersistentBase (const PersistentBase &other)=delete | |
| void | operator= (const PersistentBase &)=delete |
Public Member Functions inherited from v8::api_internal::IndirectHandleBase |
|
| bool | IsEmpty () const |
| void | Clear () |
| Friends | |
|---|---|
| class | Isolate |
| class | Utils |
| template | |
| class | Local |
| template<class F1 , class F2 > | |
| class | Persistent |
| template | |
| class | Global |
| template | |
| class | PersistentBase |
| template | |
| class | ReturnValue |
| template<class F1 , class F2 , class F3 > | |
| class | PersistentValueMapBase |
| class | Object |
| class | internal::ValueHelper |
| Additional Inherited Members | |
|---|---|
Protected Member Functions inherited from v8::api_internal::IndirectHandleBase |
|
| IndirectHandleBase ()=default | |
| IndirectHandleBase (const IndirectHandleBase &other)=default | |
| IndirectHandleBase & | operator= (const IndirectHandleBase &that)=default |
| IndirectHandleBase (internal::Address *location) | |
| internal::Address | ptr () const |
| internal::Address *const & | slot () const |
| internal::Address *& | slot () |
| template<typename T , bool check_null = false> | |
| T * | value () const |
| internal::ValueHelper::InternalRepresentationType | repr () const |
template
class v8::PersistentBase< T >
An object reference that is independent of any handle scope. Where a Local handle only lives as long as the HandleScope in which it was allocated, a PersistentBase handle remains valid until it is explicitly disposed using Reset().
A persistent handle contains a reference to a storage cell within the V8 engine which holds an object value and which is updated by the garbage collector whenever the object is moved. A new storage cell can be created using the constructor or PersistentBase::Reset and existing handles can be disposed using PersistentBase::Reset.
◆ AnnotateStrongRetainer()
Annotates the strong handle with the given label, which is then used by the heap snapshot generator as a name of the edge from the root to the handle. The function does not take ownership of the label and assumes that the label is valid as long as the handle is valid.
◆ ClearWeak() [1/2]
template
template
◆ ClearWeak() [2/2]
◆ Get()
◆ IsWeak()
Returns true if the handle's reference is weak.
◆ operator!=() [1/2]
template
template
◆ operator!=() [2/2]
template
template
◆ operator=()
◆ operator==() [1/2]
template
template
◆ operator==() [2/2]
template
template
◆ Reset() [1/3]
If non-empty, destroy the underlying storage cell IsEmpty() will return true after this call.
◆ Reset() [2/3]
template
template
If non-empty, destroy the underlying storage cell and create a new one with the contents of other if other is non empty
◆ Reset() [3/3]
template
template
If non-empty, destroy the underlying storage cell and create a new one with the contents of other if other is non empty
◆ SetWeak() [1/2]
Turns this handle into a weak phantom handle without finalization callback. The handle will be reset automatically when the garbage collector detects that the object is no longer reachable.
◆ SetWeak() [2/2]
template
template
Install a finalization callback on this object. NOTE: There is no guarantee as to when or even if the callback is invoked. The invocation is performed solely on a best effort basis. As always, GC-based finalization should not be relied upon for any critical form of resource management!
The callback is supposed to reset the handle. 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::SetSecondPassCallback.
◆ SetWrapperClassId()
Assigns a wrapper class ID to the handle.
◆ WrapperClassId()
Returns the class ID previously assigned to this handle or 0 if no class ID was previously assigned.
◆ Global
template
template
◆ internal::ValueHelper
◆ Isolate
◆ Local
template
template
◆ Object
◆ Persistent
template
template<class F1 , class F2 >
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.
◆ PersistentBase
template
template
◆ PersistentValueMapBase
template
template<class F1 , class F2 , class F3 >
◆ ReturnValue
template
template
◆ Utils
The documentation for this class was generated from the following files:
- include/v8-local-handle.h
- include/v8-persistent-handle.h
Public Member Functions inherited from