V8 Project
|
An object reference that is independent of any handle scope. More...
#include <v8.h>
Public Member Functions | |
void | Reset () |
If non-empty, destroy the underlying storage cell IsEmpty() will return true after this call. More... | |
template<class S > | |
void | Reset (Isolate *isolate, const Handle< 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. More... | |
template<class S > | |
void | Reset (Isolate *isolate, const PersistentBase< 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. More... | |
bool | IsEmpty () const |
template<class S > | |
bool | operator== (const PersistentBase< S > &that) const |
template<class S > | |
bool | operator== (const Handle< S > &that) const |
template<class S > | |
bool | operator!= (const PersistentBase< S > &that) const |
template<class S > | |
bool | operator!= (const Handle< S > &that) const |
template<typename P > | |
void | SetWeak (P *parameter, typename WeakCallbackData< T, P >::Callback callback) |
Install a finalization callback on this object. More... | |
template<typename S , typename P > | |
void | SetWeak (P *parameter, typename WeakCallbackData< S, P >::Callback callback) |
template<typename P > | |
P * | ClearWeak () |
void | ClearWeak () |
void | MarkIndependent () |
Marks the reference to this object independent. More... | |
void | MarkPartiallyDependent () |
Marks the reference to this object partially dependent. More... | |
bool | IsIndependent () const |
bool | IsNearDeath () const |
Checks if the handle holds the only reference to an object. More... | |
bool | IsWeak () const |
Returns true if the handle's reference is weak. More... | |
void | SetWrapperClassId (uint16_t class_id) |
Assigns a wrapper class ID to the handle. More... | |
uint16_t | WrapperClassId () const |
Returns the class ID previously assigned to this handle or 0 if no class ID was previously assigned. More... | |
Private Member Functions | |
PersistentBase (T *val) | |
PersistentBase (PersistentBase &other) | |
void | operator= (PersistentBase &) |
Static Private Member Functions | |
static T * | New (Isolate *isolate, T *that) |
Private Attributes | |
T * | val_ |
Friends | |
class | Isolate |
class | Utils |
template<class F > | |
class | Handle |
template<class F > | |
class | Local |
template<class F1 , class F2 > | |
class | Persistent |
template<class F > | |
class | UniquePersistent |
template<class F > | |
class | PersistentBase |
template<class F > | |
class | ReturnValue |
template<class F1 , class F2 , class F3 > | |
class | PersistentValueMap |
template<class F1 , class F2 > | |
class | PersistentValueVector |
class | Object |
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.
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.
|
inlineexplicitprivate |
|
private |
Definition at line 6134 of file v8.h.
References v8::V8::ClearWeak(), and P.
|
inline |
|
inline |
Definition at line 469 of file v8.h.
References v8::PersistentBase< T >::val_.
Referenced by v8::Persistent< T, M >::Cast(), v8::Persistent< T, M >::Copy(), main(), and v8::PersistentBase< T >::Reset().
|
inline |
|
inline |
|
inline |
Returns true if the handle's reference is weak.
Definition at line 6073 of file v8.h.
References I.
Referenced by v8::PersistentValueMap< K, V, Traits >::Release().
|
inline |
Marks the reference to this object independent.
Garbage collector is free to ignore any object groups containing this object. Weak callback for an independent handle should not assume that it will be preceded by a global GC prologue callback or followed by a global GC epilogue callback.
Definition at line 6141 of file v8.h.
References I.
|
inline |
Marks the reference to this object partially dependent.
Partially dependent handles only depend on other partially dependent handles and these dependencies are provided through object groups. It provides a way to build smaller object groups for young objects that represent only a subset of all external dependencies. This mark is automatically cleared after each garbage collection.
Definition at line 6151 of file v8.h.
References I.
|
inlinestaticprivate |
Definition at line 6031 of file v8.h.
References v8::V8::GlobalizeReference(), NULL, and T.
|
inline |
Definition at line 493 of file v8.h.
References v8::PersistentBase< T >::operator==().
|
inline |
Definition at line 489 of file v8.h.
References v8::PersistentBase< T >::operator==().
|
private |
|
inline |
Definition at line 480 of file v8.h.
References v8::Handle< T >::val_, and v8::PersistentBase< T >::val_.
|
inline |
Definition at line 472 of file v8.h.
References v8::PersistentBase< T >::val_.
Referenced by v8::PersistentBase< T >::operator!=().
|
inline |
If non-empty, destroy the underlying storage cell IsEmpty() will return true after this call.
Definition at line 6082 of file v8.h.
References v8::V8::DisposeGlobal().
Referenced by v8::ReadLineEditor::CompletionGenerator(), main(), v8::UniquePersistent< T >::operator=(), v8::Persistent< T, M >::~Persistent(), and v8::UniquePersistent< T >::~UniquePersistent().
|
inline |
If non-empty, destroy the underlying storage cell and create a new one with the contents of other if other is non empty.
Definition at line 6091 of file v8.h.
References v8::Handle< T >::IsEmpty(), S, T, TYPE_CHECK, and v8::Handle< T >::val_.
|
inline |
If non-empty, destroy the underlying storage cell and create a new one with the contents of other if other is non empty.
Definition at line 6101 of file v8.h.
References v8::PersistentBase< T >::IsEmpty(), S, T, TYPE_CHECK, and v8::PersistentBase< T >::val_.
|
inline |
Definition at line 6112 of file v8.h.
References v8::V8::MakeWeak(), S, T, and TYPE_CHECK.
|
inline |
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!
|
inline |
Assigns a wrapper class ID to the handle.
See RetainedObjectInfo interface description in v8-profiler.h for details.
Definition at line 6170 of file v8.h.
References I.
|
inline |
|
private |
Definition at line 576 of file v8.h.
Referenced by v8::PersistentValueVector< V, Traits >::Clear(), v8::PersistentValueMap< K, V, Traits >::ClearAndLeak(), v8::PersistentValueVector< V, Traits >::ClearAndLeak(), v8::Persistent< T, M >::Copy(), v8::PersistentBase< T >::IsEmpty(), v8::PersistentValueMap< K, V, Traits >::Leak(), v8::Handle< T >::New(), v8::Local< T >::New(), v8::Utils::OpenPersistent(), v8::Persistent< T, M >::operator*(), v8::UniquePersistent< T >::operator=(), v8::Handle< T >::operator==(), v8::PersistentBase< T >::operator==(), v8::PersistentValueMap< K, V, Traits >::Release(), v8::PersistentBase< T >::Reset(), v8::PersistentValueMap< K, V, Traits >::SetReference(), v8::Isolate::SetReference(), and v8::UniquePersistent< T >::UniquePersistent().