Chrome V8 - 6.9.0.0
(master)
v8::V8 Class Reference

#include <v8.h>

Public Member Functions

 V8_DEPRECATED ("Use SnapshotCreator", static StartupData CreateSnapshotDataBlob(const char *embedded_source=NULL))
 
 V8_DEPRECATED ("Use SnapshotCreator", static StartupData WarmUpSnapshotDataBlob(StartupData cold_startup_blob, const char *warmup_source))
 
 V8_DEPRECATE_SOON ("Use EnableWebAssemblyTrapHandler", static bool RegisterDefaultSignalHandler())
 

Static Public Member Functions

static void SetNativesDataBlob (StartupData *startup_blob)
 
static void SetSnapshotDataBlob (StartupData *startup_blob)
 
static void SetDcheckErrorHandler (DcheckErrorCallback that)
 
static void SetFlagsFromString (const char *str, int length)
 
static void SetFlagsFromCommandLine (int *argc, char **argv, bool remove_flags)
 
static const char * GetVersion ()
 
static bool Initialize ()
 
static void SetEntropySource (EntropySource source)
 
static void SetReturnAddressLocationResolver (ReturnAddressLocationResolver return_address_resolver)
 
static bool Dispose ()
 
static bool InitializeICU (const char *icu_data_file=nullptr)
 
static bool InitializeICUDefaultLocation (const char *exec_path, const char *icu_data_file=nullptr)
 
static void InitializeExternalStartupData (const char *directory_path)
 
static void InitializeExternalStartupData (const char *natives_blob, const char *snapshot_blob)
 
static void InitializePlatform (Platform *platform)
 
static void ShutdownPlatform ()
 
static bool EnableWebAssemblyTrapHandler (bool use_v8_signal_handler)
 

Friends

template<class K , class V , class T >
class PersistentValueMapBase
 
template<class T >
class Local
 
template<class T >
class MaybeLocal
 
template<class T >
class Maybe
 
template<class T >
class WeakCallbackInfo
 
template<class T >
class Eternal
 
template<class T >
class PersistentBase
 
template<class T , class M >
class Persistent
 
class Context
 

Detailed Description

Container class for static utility functions.

Definition at line 8255 of file v8.h.

Member Function Documentation

§ Dispose()

bool v8::V8::Dispose ( )
static

Releases any resources used by v8 and stops any utility threads that may be running. Note that disposing v8 is permanent, it cannot be reinitialized.

It should generally not be necessary to dispose v8 before exiting a process, this should happen automatically. It is only necessary to use if the process needs the resources taken up by v8.

Examples:
shell.cc.

Definition at line 6077 of file api.cc.

Here is the call graph for this function:

§ EnableWebAssemblyTrapHandler()

bool v8::V8::EnableWebAssemblyTrapHandler ( bool  use_v8_signal_handler)
static

Activate trap-based bounds checking for WebAssembly.

Parameters
use_v8_signal_handlerWhether V8 should install its own signal handler or rely on the embedder's.

Definition at line 6062 of file api.cc.

Here is the call graph for this function:

§ GetVersion()

const char * v8::V8::GetVersion ( )
static

Get the version string.

Examples:
shell.cc.

Definition at line 6136 of file api.cc.

Here is the call graph for this function:

§ Initialize()

bool v8::V8::Initialize ( )
static

Initializes V8. This function needs to be called before the first Isolate is created. It always returns true.

Examples:
process.cc, and shell.cc.

Definition at line 6039 of file api.cc.

Here is the call graph for this function:

§ InitializeExternalStartupData() [1/2]

void v8::V8::InitializeExternalStartupData ( const char *  directory_path)
static

Initialize the external startup data. The embedder only needs to invoke this method when external startup data was enabled in a build.

If V8 was compiled with the startup data in an external file, then V8 needs to be given those external files during startup. There are three ways to do this:

Examples:
process.cc, and shell.cc.

Definition at line 6125 of file api.cc.

Here is the call graph for this function:

§ InitializeExternalStartupData() [2/2]

void v8::V8::InitializeExternalStartupData ( const char *  natives_blob,
const char *  snapshot_blob 
)
static

Definition at line 6130 of file api.cc.

Here is the call graph for this function:

§ InitializeICU()

bool v8::V8::InitializeICU ( const char *  icu_data_file = nullptr)
static

Initialize the ICU library bundled with V8. The embedder should only invoke this method when using the bundled ICU. Returns true on success.

If V8 was compiled with the ICU data in an external file, the location of the data file has to be provided.

Definition at line 6116 of file api.cc.

Here is the call graph for this function:

§ InitializeICUDefaultLocation()

bool v8::V8::InitializeICUDefaultLocation ( const char *  exec_path,
const char *  icu_data_file = nullptr 
)
static

Initialize the ICU library bundled with V8. The embedder should only invoke this method when using the bundled ICU. If V8 was compiled with the ICU data in an external file and when the default location of that file should be used, a path to the executable must be provided. Returns true on success.

The default is a file called icudtl.dat side-by-side with the executable.

Optionally, the location of the data file can be provided to override the default.

Examples:
process.cc, and shell.cc.

Definition at line 6120 of file api.cc.

Here is the call graph for this function:

§ InitializePlatform()

void v8::V8::InitializePlatform ( Platform platform)
static

Sets the v8::Platform to use. This should be invoked before V8 is initialized.

Examples:
process.cc, and shell.cc.

Definition at line 6029 of file api.cc.

Here is the call graph for this function:

§ SetDcheckErrorHandler()

void v8::V8::SetDcheckErrorHandler ( DcheckErrorCallback  that)
static

Set the callback to invoke in case of Dcheck failures.

Definition at line 910 of file api.cc.

Here is the call graph for this function:

§ SetEntropySource()

void v8::V8::SetEntropySource ( EntropySource  source)
static

Allows the host application to provide a callback which can be used as a source of entropy for random number generators.

Definition at line 6066 of file api.cc.

Here is the call graph for this function:

§ SetFlagsFromCommandLine()

void v8::V8::SetFlagsFromCommandLine ( int *  argc,
char **  argv,
bool  remove_flags 
)
static

Sets V8 flags from the command line.

Examples:
shell.cc.

Definition at line 920 of file api.cc.

Here is the call graph for this function:

§ SetFlagsFromString()

void v8::V8::SetFlagsFromString ( const char *  str,
int  length 
)
static

Sets V8 flags from a string.

Definition at line 914 of file api.cc.

Here is the call graph for this function:

§ SetNativesDataBlob()

void v8::V8::SetNativesDataBlob ( StartupData startup_blob)
static

Hand startup data to V8, in case the embedder has chosen to build V8 with external startup data.

Note:

  • By default the startup data is linked into the V8 library, in which case this function is not meaningful.
  • If this needs to be called, it needs to be called before V8 tries to make use of its built-ins.
  • To avoid unnecessary copies of data, V8 will point directly into the given data blob, so pretty please keep it around until V8 exit.
  • Compression of the startup blob might be useful, but needs to handled entirely on the embedders' side.
  • The call will abort if the data is invalid.

Definition at line 476 of file api.cc.

Here is the call graph for this function:

§ SetReturnAddressLocationResolver()

void v8::V8::SetReturnAddressLocationResolver ( ReturnAddressLocationResolver  return_address_resolver)
static

Allows the host application to provide a callback that allows v8 to cooperate with a profiler that rewrites return addresses on stack.

Definition at line 6071 of file api.cc.

§ SetSnapshotDataBlob()

void v8::V8::SetSnapshotDataBlob ( StartupData startup_blob)
static

Definition at line 481 of file api.cc.

Here is the call graph for this function:

§ ShutdownPlatform()

void v8::V8::ShutdownPlatform ( )
static

Clears all references to the v8::Platform. This should be invoked after V8 was disposed.

Examples:
shell.cc.

Definition at line 6034 of file api.cc.

Here is the call graph for this function:

§ V8_DEPRECATE_SOON()

v8::V8::V8_DEPRECATE_SOON ( "Use EnableWebAssemblyTrapHandler ,
static bool   RegisterDefaultSignalHandler() 
)

Enable the default signal handler rather than using one provided by the embedder.

§ V8_DEPRECATED() [1/2]

v8::V8::V8_DEPRECATED ( "Use SnapshotCreator ,
static StartupData   CreateSnapshotDataBlobconst char *embedded_source=NULL 
)

Bootstrap an isolate and a context from scratch to create a startup snapshot. Include the side-effects of running the optional script. Returns { NULL, 0 } on failure. The caller acquires ownership of the data array in the return value.

§ V8_DEPRECATED() [2/2]

v8::V8::V8_DEPRECATED ( "Use SnapshotCreator ,
static StartupData   WarmUpSnapshotDataBlobStartupData cold_startup_blob, const char *warmup_source 
)

Bootstrap an isolate and a context from the cold startup blob, run the warm-up script to trigger code compilation. The side effects are then discarded. The resulting startup snapshot will include compiled code. Returns { NULL, 0 } on failure. The caller acquires ownership of the data array in the return value. The argument startup blob is untouched.

Friends And Related Function Documentation

§ Context

friend class Context
friend

Definition at line 8480 of file v8.h.

§ Eternal

template<class T >
friend class Eternal
friend

Definition at line 8477 of file v8.h.

§ Local

template<class T >
friend class Local
friend

Definition at line 8470 of file v8.h.

§ Maybe

template<class T >
friend class Maybe
friend

Definition at line 8474 of file v8.h.

§ MaybeLocal

template<class T >
friend class MaybeLocal
friend

Definition at line 8472 of file v8.h.

§ Persistent

template<class T , class M >
friend class Persistent
friend

Definition at line 8479 of file v8.h.

§ PersistentBase

template<class T >
friend class PersistentBase
friend

Definition at line 8478 of file v8.h.

§ PersistentValueMapBase

template<class K , class V , class T >
friend class PersistentValueMapBase
friend

Definition at line 8465 of file v8.h.

§ WeakCallbackInfo

template<class T >
friend class WeakCallbackInfo
friend

Definition at line 8476 of file v8.h.


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