Skip to main content

Module execution

Module execution 

Source

Structs§

BridgeCodeCache
Cached V8 code cache data for bridge code compilation.

Traits§

GuestModuleReader
Thread-local state for module resolution during execute_module. Avoids passing user data through V8’s ResolveModuleCallback (which is a plain fn pointer). Direct, in-process module source reader living on the V8 session thread.

Functions§

clear_module_state
clear_pending_module_evaluation
clear_pending_script_evaluation
dynamic_import_callback
execute_module
Execute user code as an ES module (mode=‘run’).
execute_script
Execute user code as a CJS script (mode=‘exec’).
execute_script_with_options
extract_process_exit_code
Check if a V8 exception is a ProcessExitError (has _isProcessExit: true sentinel). Returns Some(exit_code) if detected, None otherwise.
finalize_pending_module_evaluation
finalize_pending_script_evaluation
has_pending_module_evaluation
has_pending_script_evaluation
import_meta_object_callback
Callback invoked by V8 when import.meta is accessed in an ES module. Sets import.meta.url to a file:// URL derived from the module’s resource name.
inject_globals_from_payload
Inject globals from a V8-serialized payload containing { processConfig, osConfig }.
install_high_resolution_time_global
install_session_guest_reader
Install (or clear) the direct module reader for the current session thread. Called by the session thread when it receives a SetModuleReader command; the next execute_module moves it into the resolve state. Must be called on the session/isolate thread.
pending_module_evaluation_needs_wait
pending_script_evaluation_needs_wait
run_init_script
Run a short init script (e.g. post-restore config). Compiles and executes via v8::Script, returning (exit_code, error) on failure. No code caching.
set_pending_script_evaluation