Loading...
Searching...
No Matches
Static Public Member Functions | Public Attributes | List of all members
v8::FastApiCallbackOptions Struct Reference

#include <v8-fast-api-calls.h>

Collaboration diagram for v8::FastApiCallbackOptions:
[legend]

Static Public Member Functions

static FastApiCallbackOptions CreateForTesting (Isolate *isolate)
 

Public Attributes

bool fallback
 
union {
   uintptr_t   data_ptr
 
   v8::Local< v8::Value >   data
 
}; 
 
FastApiTypedArray< uint8_t > *const wasm_memory
 

Detailed Description

A struct which may be passed to a fast call callback, like so:

void FastMethodWithOptions(int param, FastApiCallbackOptions& options);
Definition: v8-fast-api-calls.h:574

Member Function Documentation

◆ CreateForTesting()

static FastApiCallbackOptions v8::FastApiCallbackOptions::CreateForTesting ( Isolate isolate)
inlinestatic

Creates a new instance of FastApiCallbackOptions for testing purpose. The returned instance may be filled with mock data.

Member Data Documentation

◆ 

union { ... } v8::FastApiCallbackOptions::@5

The data passed to the FunctionTemplate constructor, or undefined. data_ptr allows for default constructing FastApiCallbackOptions.

◆ data

v8::Local<v8::Value> v8::FastApiCallbackOptions::data

◆ data_ptr

uintptr_t v8::FastApiCallbackOptions::data_ptr

◆ fallback

bool v8::FastApiCallbackOptions::fallback

If the callback wants to signal an error condition or to perform an allocation, it must set options.fallback to true and do an early return from the fast method. Then V8 checks the value of options.fallback and if it's true, falls back to executing the SlowCallback, which is capable of reporting the error (either by throwing a JS exception or logging to the console) or doing the allocation. It's the embedder's responsibility to ensure that the fast callback is idempotent up to the point where error and fallback conditions are checked, because otherwise executing the slow callback might produce visible side-effects twice.

◆ wasm_memory

FastApiTypedArray<uint8_t>* const v8::FastApiCallbackOptions::wasm_memory

When called from WebAssembly, a view of the calling module's memory.


The documentation for this struct was generated from the following file: