v8  3.14.5 (node 0.10.48)
V8 is Google's open source JavaScript engine
HandleScope Class Reference

#include <v8.h>

Public Member Functions

 HandleScope ()
 
 ~HandleScope ()
 
template<class T >
Local< T > Close (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

◆ HandleScope()

◆ ~HandleScope()

Member Function Documentation

◆ Close()

Local< T > Close ( Handle< T >  value)

Closes the handle scope and returns the value as a handle in the previous scope, which is the new current scope after the call.

Definition at line 4324 of file v8.h.

References V8::Local.

◆ CreateHandle() [1/2]

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

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

◆ CreateHandle() [2/2]

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

Creates a new handle with the given value.

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

◆ NumberOfHandles()

static int NumberOfHandles ( )
static

Counts the number of allocated handles.

Friends And Related Function Documentation

◆ ImplementationUtilities

friend class ImplementationUtilities
friend

Definition at line 502 of file v8.h.


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