Data Structures | Public Member Functions | Static Public Member Functions

v8::Isolate Class Reference

Isolate represents an isolated instance of the V8 engine. More...

#include <v8.h>

Data Structures

class  Scope
 Stack-allocated class which sets the isolate for all operations executed within a local scope. More...

Public Member Functions

void Dispose ()
 Disposes the isolate.
void Enter ()
 Methods below this point require holding a lock (using Locker) in a multi-threaded environment.
void Exit ()
 Exits this isolate by restoring the previously entered one in the current thread.
void * GetData ()
 Retrive embedder-specific data from the isolate.
void SetData (void *data)
 Associate embedder-specific data with the isolate.

Static Public Member Functions

static IsolateGetCurrent ()
 Returns the entered isolate for the current thread or NULL in case there is no current isolate.
static IsolateNew ()
 Creates a new isolate.

Detailed Description

Isolate represents an isolated instance of the V8 engine.

V8 isolates have completely separate states. Objects from one isolate must not be used in other isolates. When V8 is initialized a default isolate is implicitly created and entered. The embedder can create additional isolates and use them in parallel in multiple threads. An isolate can be entered by at most one thread at any given time. The Locker/Unlocker API can be used to synchronize.

Definition at line 2692 of file v8.h.


Member Function Documentation

void v8::Isolate::Dispose (  ) 

Disposes the isolate.

The isolate must not be entered by any thread to be disposable.

void v8::Isolate::Enter (  ) 

Methods below this point require holding a lock (using Locker) in a multi-threaded environment.

Sets this isolate as the entered one for the current thread. Saves the previously entered one (if any), so that it can be restored when exiting. Re-entering an isolate is allowed.

Referenced by v8::Isolate::Scope::Scope().

void v8::Isolate::Exit (  ) 

Exits this isolate by restoring the previously entered one in the current thread.

The isolate may still stay the same, if it was entered more than once.

Requires: this == Isolate::GetCurrent().

static Isolate* v8::Isolate::GetCurrent (  )  [static]

Returns the entered isolate for the current thread or NULL in case there is no current isolate.

void* v8::Isolate::GetData (  ) 

Retrive embedder-specific data from the isolate.

Returns NULL if SetData has never been called.

static Isolate* v8::Isolate::New (  )  [static]

Creates a new isolate.

Does not change the currently entered isolate.

When an isolate is no longer used its resources should be freed by calling Dispose(). Using the delete operator is not allowed.

void v8::Isolate::SetData ( void *  data  ) 

Associate embedder-specific data with the isolate.


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