v8
7.0.276 (node 11.14.0)
V8 is Google's open source JavaScript engine
|
#include <v8.h>
Public Member Functions | |
WasmStreaming (std::unique_ptr< WasmStreamingImpl > impl) | |
~WasmStreaming () | |
void | OnBytesReceived (const uint8_t *bytes, size_t size) |
void | Finish () |
void | Abort (MaybeLocal< Value > exception) |
Static Public Member Functions | |
static std::shared_ptr< WasmStreaming > | Unpack (Isolate *isolate, Local< Value > value) |
The V8 interface for WebAssembly streaming compilation. When streaming compilation is initiated, V8 passes a {WasmStreaming} object to the embedder such that the embedder can pass the input butes for streaming compilation to V8.
WasmStreaming | ( | std::unique_ptr< WasmStreamingImpl > | impl | ) |
~WasmStreaming | ( | ) |
void Abort | ( | MaybeLocal< Value > | exception | ) |
Abort streaming compilation. If {exception} has a value, then the promise associated with streaming compilation is rejected with that value. If {exception} does not have value, the promise does not get rejected.
void Finish | ( | ) |
{Finish} should be called after all received bytes where passed to {OnBytesReceived} to tell V8 that there will be no more bytes. {Finish} does not have to be called after {Abort} has been called already.
void OnBytesReceived | ( | const uint8_t * | bytes, |
size_t | size | ||
) |
Pass a new chunck of bytes to WebAssembly streaming compilation. The buffer passed into {OnBytesReceived} is owned by the caller.
|
static |
Unpacks a {WasmStreaming} object wrapped in a {Managed} for the embedder. Since the embedder is on the other side of the API, it cannot unpack the {Managed} itself.