#include <v8-initialization.h>
Public Types | |
| enum class | WasmMemoryType { kMemory32 , kMemory64 } |
Static Public Member Functions | |
| static void | SetSnapshotDataBlob (StartupData *startup_blob) |
| static void | SetDcheckErrorHandler (DcheckErrorCallback that) |
| static void | SetFatalErrorHandler (V8FatalErrorCallback that) |
| static void | SetFlagsFromString (const char *str) |
| static void | SetFlagsFromString (const char *str, size_t 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 | InitializeExternalStartupDataFromFile (const char *snapshot_blob) |
| static void | InitializePlatform (Platform *platform) |
| static void | DisposePlatform () |
| static size_t | GetWasmMemoryReservationSizeInBytes (WasmMemoryType type, size_t byte_capacity) |
| static bool | EnableWebAssemblyTrapHandler (bool use_v8_signal_handler) |
| static void | SetFatalMemoryErrorCallback (OOMErrorCallback callback) |
| static void | GetSharedMemoryStatistics (SharedMemoryStatistics *statistics) |
Friends | |
| class | Context |
| template<class K , class V , class T > | |
| class | PersistentValueMapBase |
Container class for static utility functions.
|
strong |
|
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 |
Clears all references to the v8::Platform. This should be invoked after V8 was disposed.
|
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 statistics about the shared memory usage.
|
static |
Get the version string.
|
static |
Returns the virtual address space reservation size (in bytes) needed for one WebAssembly memory instance of the given capacity.
| type | Whether this is a memory32 or memory64 instance. |
| byte_capacity | The maximum size, in bytes, of the WebAssembly memory. Values exceeding the engine's maximum allocatable memory size for the given type (determined by max_mem32_pages or max_mem64_pages) are clamped. |
When trap-based bounds checking is enabled by EnableWebAssemblyTrapHandler(), the amount of virtual address space that V8 needs to reserve for each WebAssembly memory instance can be much bigger than the requested size. If the process does not have enough virtual memory available, WebAssembly memory allocation would fail. During the initialization of V8, embedders can use this method to estimate whether the process has enough virtual memory for their usage of WebAssembly, and decide whether to enable the trap handler via EnableWebAssemblyTrapHandler(), or to skip it and reduce the amount of virtual memory required to keep the application running.
|
inlinestatic |
Initializes V8. This function needs to be called before the first Isolate is created. It always returns true.
|
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 |
|
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 |
Set the callback to invoke in the case of CHECK failures or fatal errors. This is distinct from Isolate::SetFatalErrorHandler, which is invoked in response to API usage failures.
|
static |
Allows the host application to provide a callback that will be called when v8 has encountered a fatal failure to allocate memory and is about to terminate.
|
static |
|
static |
Sets V8 flags from a string.
|
static |
|
static |
Allows the host application to provide a callback that allows v8 to cooperate with a profiler that rewrites return addresses on stack.
|
static |
Hand startup data to V8, in case the embedder has chosen to build V8 with external startup data.
Note:
|
friend |
|
friend |