v8 13.6.233 (node 24.1.0)
V8 is Google's open source JavaScript engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages Concepts
HandleScope Class Reference

#include <v8-local-handle.h>

Inheritance diagram for HandleScope:

Public Member Functions

 HandleScope (Isolate *isolate)
 
 ~HandleScope ()
 
V8_INLINE IsolateGetIsolate () const
 
 HandleScope (const HandleScope &)=delete
 
void operator= (const HandleScope &)=delete
 

Static Public Member Functions

static int NumberOfHandles (Isolate *isolate)
 
static internal::AddressCreateHandleForCurrentIsolate (internal::Address value)
 

Protected Member Functions

V8_INLINE HandleScope ()=default
 
void Initialize (Isolate *isolate)
 

Static Protected Member Functions

static internal::AddressCreateHandle (internal::Isolate *i_isolate, internal::Address value)
 

Friends

template<typename T>
class LocalBase
 
class Object
 
class Context
 

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 97 of file v8-local-handle.h.

Constructor & Destructor Documentation

◆ HandleScope() [1/3]

HandleScope ( Isolate * isolate)
explicit

Referenced by HandleScope(), and operator=().

◆ ~HandleScope()

◆ HandleScope() [2/3]

HandleScope ( const HandleScope & )
delete

References HandleScope().

◆ HandleScope() [3/3]

V8_INLINE HandleScope ( )
protecteddefault

References V8_INLINE.

Member Function Documentation

◆ CreateHandle()

static internal::Address * CreateHandle ( internal::Isolate * i_isolate,
internal::Address value )
staticprotected

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

◆ CreateHandleForCurrentIsolate()

static internal::Address * CreateHandleForCurrentIsolate ( internal::Address value)
static

◆ GetIsolate()

V8_INLINE Isolate * GetIsolate ( ) const
inline

Definition at line 108 of file v8-local-handle.h.

References V8_INLINE.

◆ Initialize()

void Initialize ( Isolate * isolate)
protected

◆ NumberOfHandles()

static int NumberOfHandles ( Isolate * isolate)
static

Counts the number of allocated handles.

◆ operator=()

void operator= ( const HandleScope & )
delete

References HandleScope().

Friends And Related Symbol Documentation

◆ Context

friend class Context
friend

Definition at line 148 of file v8-local-handle.h.

References Context.

Referenced by Context.

◆ LocalBase

template<typename T>
friend class LocalBase
friend

Definition at line 143 of file v8-local-handle.h.

References LocalBase.

Referenced by LocalBase.

◆ Object

friend class Object
friend

Definition at line 147 of file v8-local-handle.h.

References Object.

Referenced by Object.


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