v8  3.14.5(node0.10.28)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HandleScope Class Reference

#include <v8.h>

Public Member Functions

 HandleScope ()
 
 ~HandleScope ()
 
template<class T >
Local< TClose (Handle< T > value)
 

Static Public Member Functions

static int NumberOfHandles ()
 
static internal::Object ** CreateHandle (internal::Object *value)
 
static internal::Object ** CreateHandle (internal::HeapObject *value)
 

Friends

class ImplementationUtilities
 

Detailed Description

A stack-allocated class that governs a number of local handles. After a handle scope has been created, all local handles will be allocated within that handle scope until either the handle scope is deleted or another handle scope is created. If there is already a handle scope and a new one is created, all allocations will take place in the new handle scope until it is deleted. After that, new handles will again be allocated in the original handle scope.

After the handle scope of a local handle has been deleted the garbage collector will no longer track the object stored in the handle and may deallocate it. The behavior of accessing a handle for which the handle scope has been deleted is undefined.

Definition at line 446 of file v8.h.

Constructor & Destructor Documentation

Definition at line 685 of file api.cc.

References API_ENTRY_CHECK, and Isolate::handle_scope_data().

Definition at line 698 of file api.cc.

Member Function Documentation

Local< T > Close ( Handle< T value)
i::Object ** CreateHandle ( internal::Object value)
static

Creates a new handle with the given value.

Definition at line 730 of file api.cc.

References HandleScope::CreateHandle().

Referenced by Local< T >::New().

i::Object ** CreateHandle ( internal::HeapObject value)
static

Definition at line 735 of file api.cc.

References ASSERT, HandleScope::CreateHandle(), and HeapObject::GetIsolate().

int NumberOfHandles ( )
static

Counts the number of allocated handles.

Definition at line 723 of file api.cc.

References HandleScope::NumberOfHandles().

Friends And Related Function Documentation

friend class ImplementationUtilities
friend

Definition at line 502 of file v8.h.


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