V8 API Reference, 7.2.502.16 (for Deno 0.2.4)
v8::WasmStreaming Class Referencefinal

#include <v8.h>

Classes

class  WasmStreamingImpl
 

Public Types

typedef void(* ModuleCompiledCallback) (intptr_t data, Local< WasmCompiledModule > compiled_module)
 

Public Member Functions

 WasmStreaming (std::unique_ptr< WasmStreamingImpl > impl)
 
void OnBytesReceived (const uint8_t *bytes, size_t size)
 
void Finish ()
 
void Abort (MaybeLocal< Value > exception)
 
void SetModuleCompiledCallback (ModuleCompiledCallback callback, intptr_t data)
 
bool SetCompiledModuleBytes (const uint8_t *bytes, size_t size)
 

Static Public Member Functions

static std::shared_ptr< WasmStreamingUnpack (Isolate *isolate, Local< Value > value)
 

Detailed Description

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 bytes for streaming compilation to V8.

Definition at line 4375 of file v8.h.

Member Typedef Documentation

◆ ModuleCompiledCallback

typedef void(* v8::WasmStreaming::ModuleCompiledCallback) (intptr_t data, Local< WasmCompiledModule > compiled_module)

Callback for module compiled notifications. |data| is the identifier passed to {SetModuleCompiledCallback}, |compiled_module| is the result.

Definition at line 4407 of file v8.h.

Member Function Documentation

◆ Abort()

void v8::WasmStreaming::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.

Definition at line 99 of file wasm-js.cc.

◆ Finish()

void v8::WasmStreaming::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.

Definition at line 97 of file wasm-js.cc.

◆ OnBytesReceived()

void v8::WasmStreaming::OnBytesReceived ( const uint8_t *  bytes,
size_t  size 
)

Pass a new chunk of bytes to WebAssembly streaming compilation. The buffer passed into {OnBytesReceived} is owned by the caller.

Definition at line 93 of file wasm-js.cc.

◆ SetCompiledModuleBytes()

bool v8::WasmStreaming::SetCompiledModuleBytes ( const uint8_t *  bytes,
size_t  size 
)

Passes previously compiled module bytes. This must be called before calling any non-static methods of this class. Returns true if the module bytes can be used, false otherwise. The buffer passed into {SetCompiledModuleBytes} is owned by the caller. If {SetCompiledModuleBytes} returns true, the buffer must remain valid until either {Finish} or {Abort} completes.

Definition at line 108 of file wasm-js.cc.

◆ SetModuleCompiledCallback()

void v8::WasmStreaming::SetModuleCompiledCallback ( ModuleCompiledCallback  callback,
intptr_t  data 
)

Sets a callback for when compilation of the Wasm module has been completed to the highest tier. |data| will be passed as the first callback parameter.

Definition at line 103 of file wasm-js.cc.

◆ Unpack()

std::shared_ptr< WasmStreaming > v8::WasmStreaming::Unpack ( Isolate *  isolate,
Local< Value value 
)
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.

Definition at line 113 of file wasm-js.cc.


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