v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::HandleScope Class Reference

#include <v8-local-handle.h>

Inheritance diagram for v8::HandleScope:
Collaboration diagram for v8::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)
 

Private Member Functions

void * operator new (size_t size)
 
void * operator new[] (size_t size)
 
void operator delete (void *, size_t)
 
void operator delete[] (void *, size_t)
 

Private Attributes

internal::Isolatei_isolate_
 
internal::Addressprev_next_
 
internal::Addressprev_limit_
 

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]

v8::HandleScope::HandleScope ( Isolate * isolate)
explicit

Definition at line 692 of file api.cc.

Here is the call graph for this function:

◆ ~HandleScope()

v8::HandleScope::~HandleScope ( )

Definition at line 716 of file api.cc.

Here is the call graph for this function:

◆ HandleScope() [2/3]

v8::HandleScope::HandleScope ( const HandleScope & )
delete

◆ HandleScope() [3/3]

V8_INLINE v8::HandleScope::HandleScope ( )
protecteddefault

Member Function Documentation

◆ CreateHandle()

static internal::Address * v8::HandleScope::CreateHandle ( internal::Isolate * i_isolate,
internal::Address value )
staticprotected
Here is the caller graph for this function:

◆ CreateHandleForCurrentIsolate()

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

◆ GetIsolate()

V8_INLINE Isolate * v8::HandleScope::GetIsolate ( ) const
inline

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

Here is the caller graph for this function:

◆ Initialize()

void v8::HandleScope::Initialize ( Isolate * isolate)
protected

Definition at line 694 of file api.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ NumberOfHandles()

int v8::HandleScope::NumberOfHandles ( Isolate * isolate)
static

Counts the number of allocated handles.

Definition at line 728 of file api.cc.

Here is the caller graph for this function:

◆ operator delete()

void v8::HandleScope::operator delete ( void * ,
size_t  )
private

Definition at line 725 of file api.cc.

Here is the call graph for this function:

◆ operator delete[]()

void v8::HandleScope::operator delete[] ( void * ,
size_t  )
private

Definition at line 726 of file api.cc.

Here is the call graph for this function:

◆ operator new()

void * v8::HandleScope::operator new ( size_t size)
private

Definition at line 723 of file api.cc.

Here is the call graph for this function:

◆ operator new[]()

void * v8::HandleScope::operator new[] ( size_t size)
private

Definition at line 724 of file api.cc.

Here is the call graph for this function:

◆ operator=()

void v8::HandleScope::operator= ( const HandleScope & )
delete

Friends And Related Symbol Documentation

◆ Context

friend class Context
friend

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

◆ LocalBase

template<typename T >
friend class LocalBase
friend

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

◆ Object

friend class Object
friend

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

Member Data Documentation

◆ i_isolate_

internal::Isolate* v8::HandleScope::i_isolate_
private

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

◆ prev_limit_

internal::Address* v8::HandleScope::prev_limit_
private

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

◆ prev_next_

internal::Address* v8::HandleScope::prev_next_
private

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


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