v8
3.28.71 (node 0.12.18)
V8 is Google's open source JavaScript engine
|
#include <v8.h>
Public Member Functions | |
V8_INLINE | Handle () |
template<class S > | |
V8_INLINE | Handle (Handle< S > that) |
V8_INLINE bool | IsEmpty () const |
V8_INLINE void | Clear () |
V8_INLINE T * | operator-> () const |
V8_INLINE T * | operator* () const |
template<class S > | |
V8_INLINE bool | operator== (const Handle< S > &that) const |
template<class S > | |
V8_INLINE bool | operator== (const PersistentBase< S > &that) const |
template<class S > | |
V8_INLINE bool | operator!= (const Handle< S > &that) const |
template<class S > | |
V8_INLINE bool | operator!= (const Persistent< S > &that) const |
template<class S > | |
V8_INLINE Handle< S > | As () |
Static Public Member Functions | |
template<class S > | |
static V8_INLINE Handle< T > | Cast (Handle< S > that) |
static V8_INLINE Handle< T > | New (Isolate *isolate, Handle< T > that) |
static V8_INLINE Handle< T > | New (Isolate *isolate, const PersistentBase< T > &that) |
Friends | |
class | Utils |
template<class F , class M > | |
class | Persistent |
template<class F > | |
class | PersistentBase |
template<class F > | |
class | Handle |
template<class F > | |
class | Local |
template<class F > | |
class | FunctionCallbackInfo |
template<class F > | |
class | PropertyCallbackInfo |
template<class F > | |
class | internal::CustomArguments |
class | Context |
class | HandleScope |
class | Object |
class | Private |
Handle< Primitive > | Undefined (Isolate *isolate) |
Handle< Primitive > | Null (Isolate *isolate) |
Handle< Boolean > | True (Isolate *isolate) |
Handle< Boolean > | False (Isolate *isolate) |
An object reference managed by the v8 garbage collector.
All objects returned from v8 have to be tracked by the garbage collector so that it knows that the objects are still alive. Also, because the garbage collector may move objects, it is unsafe to point directly to an object. Instead, all objects are stored in handles which are known by the garbage collector and updated whenever an object moves. Handles should always be passed by value (except in cases like out-parameters) and they should never be allocated on the heap.
There are two types of handles: local and persistent handles. Local handles are light-weight and transient and typically used in local operations. They are managed by HandleScopes. Persistent handles can be used when storing objects across several independent operations and have to be explicitly deallocated when they're no longer used.
It is safe to extract the object stored in the handle by dereferencing the handle (for instance, to extract the Object* from a Handle<Object>); the value will still be governed by a handle behind the scenes and the same rules apply to these values as to their handles.
Creates an empty handle.
Definition at line 201 of file v8.h.
Referenced by Extension::GetNativeFunctionTemplate().
Creates a handle for the contents of the specified handle. This constructor allows you to pass handles as arguments by value and to assign between handles. However, if you try to assign between incompatible handles, for instance from a Handle<String> to a Handle<Number> it will cause a compile-time error. Assigning between compatible handles, for instance assigning a Handle<String> to a variable declared as Handle<Value>, is legal because String is a subclass of Value.
This check fails when trying to convert between incompatible handles. For example, converting from a Handle<String> to a Handle<Number>.
Definition at line 284 of file v8.h.
References Handle< T >::Handle.
Definition at line 275 of file v8.h.
References Handle< T >::Handle.
|
inline |
|
inline |
|
inlinestatic |
|
inline |
|
inline |
Definition at line 235 of file v8.h.
Referenced by Eternal< T >::Get().
|
inline |
Definition at line 233 of file v8.h.
Referenced by Context::Scope::Scope(), Script::V8_DEPRECATED(), and Context::Scope::~Scope().
|
inline |
Definition at line 6622 of file v8.h.
Referenced by Boolean::New().
|
friend |
|
friend |
Definition at line 300 of file v8.h.
Referenced by Handle< T >::As(), Handle< T >::Cast(), Extension::GetNativeFunctionTemplate(), and Local< T >::Local().
|
friend |
|
friend |
|
friend |
Definition at line 301 of file v8.h.
Referenced by Local< T >::As(), FunctionCallbackInfo< T >::Callee(), Local< T >::Cast(), FunctionCallbackInfo< T >::Data(), PropertyCallbackInfo< T >::Data(), String::Empty(), EscapableHandleScope::Escape(), PersistentValueMap< K, V, Traits >::Get(), Eternal< T >::Get(), PersistentValueVector< V, Traits >::Get(), Context::GetEmbedderData(), Object::GetInternalField(), FunctionCallbackInfo< T >::Holder(), PropertyCallbackInfo< T >::Holder(), PersistentValueMap< K, V, Traits >::PersistentValueReference::NewLocal(), FunctionCallbackInfo< T >::operator[](), FunctionCallbackInfo< T >::This(), and PropertyCallbackInfo< T >::This().
|
friend |
Definition at line 298 of file v8.h.
Referenced by Persistent< T, M >::As(), and Persistent< T, M >::Cast().
|
friend |
Definition at line 299 of file v8.h.
Referenced by Persistent< T, M >::Persistent(), and UniquePersistent< T >::UniquePersistent().
|
friend |
Definition at line 6613 of file v8.h.
Referenced by Boolean::New().