V8 API Reference Guide generated from the header files
|
#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) |
Container class for static utility functions.
|
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.
|
static |
Activate trap-based bounds checking for WebAssembly.
use_v8_signal_handler | Whether V8 should install its own signal handler or rely on the embedder's. |
|
static |
Get the version string.
|
static |
|
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:
|
static |
|
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.
|
static |
Sets the v8::Platform to use. This should be invoked before V8 is initialized.
|
static |
Set the callback to invoke in case of Dcheck failures.
|
static |
Allows the host application to provide a callback which can be used as a source of entropy for random number generators.
|
static |
Sets V8 flags from the command line.
|
static |
Sets V8 flags from a string.
|
static |
Hand startup data to V8, in case the embedder has chosen to build V8 with external startup data.
Note:
|
static |
Allows the host application to provide a callback that allows v8 to cooperate with a profiler that rewrites return addresses on stack.
|
static |
Clears all references to the v8::Platform. This should be invoked after V8 was disposed.
v8::V8::V8_DEPRECATE_SOON | ( | "Use EnableWebAssemblyTrapHandler" | , |
static bool | RegisterDefaultSignalHandler() | ||
) |
Enable the default signal handler rather than using one provided by the embedder.
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::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.