v8 10.2.154 (node 18.16.0)
V8 is Google's open source JavaScript engine
|
#include <v8-fast-api-calls.h>
Static Public Member Functions | |
static FastApiCallbackOptions | CreateForTesting (Isolate *isolate) |
Data Fields | ||
bool | fallback | |
union { | ||
uintptr_t data_ptr | ||
v8::Value data | ||
}; | ||
A struct which may be passed to a fast call callback, like so:
Definition at line 541 of file v8-fast-api-calls.h.
|
inlinestatic |
Creates a new instance of FastApiCallbackOptions for testing purpose. The returned instance may be filled with mock data.
Definition at line 546 of file v8-fast-api-calls.h.
union { ... } |
The data
passed to the FunctionTemplate constructor, or undefined
. data_ptr
allows for default constructing FastApiCallbackOptions.
v8::Value data |
Definition at line 569 of file v8-fast-api-calls.h.
uintptr_t data_ptr |
Definition at line 568 of file v8-fast-api-calls.h.
bool 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.
Definition at line 561 of file v8-fast-api-calls.h.