Wasm Interpreter Types
UrWasm's +engine-sur types represent Wasm modules in their executable form. While +wasm-sur implements the WebAssembly Core Specification, +engine-sur provides the runtime representation needed for execution, with some optimizations.
+engine-sur
++ engine-sur
=, wasm-sur
|%
:: ...
:: ...Wrapper arm around the engine types, making them addressable by limb resolution paths like module:engine-sur. Also exposes the +wasm-sur namespace so it can refer to types like $type-section directly.
$module
+$ module
$:
=type-section
::
=import-section :: Changed
=function-section :: Changed to include code
::
=table-section
=memory-section
=global-section
=export-section
=start-section
=elem-section
:: =datacnt-section :: Removed
:: =code-section :: Code moved to function section
=data-section
==Wasm $module as seen by the engine. Some sections have been removed or modified for efficiency:
$code-sectionis merged into the function section.$datacnt-sectionis removed as it's not needed during execution.$import-sectionis restructured for runtime resolution.
$function
This includes both the function signature and its implementation merged together:
.type-id: Index into the$type-sectionfor this function's signature..locals: Local variables for this function..expression: The function body as a sequence of$instructions.
$function-section
List of $functions in the $module.
$import-section
Restructured import section organized by import type for efficient runtime resolution:
.funcs: Imported functions with module name, export name, and type signature by index..tables: Imported$tables with their specifications..memos: Imported memories with size$limits..globs: Imported global variables with value type and mutability.
$store
Complete module store containing:
.shop: Resolved import dependencies (see$shop)..module: The engine's$module..mem: Optional memory buffer with page count..tables: Table instances containing function references..globals: Global variable values.
$local-state
Execution state for a function call:
.stack: Current execution stack (see$stack)..locals: Local variable values for current function..store: Module store containing all persistent state.
$stack
Execution stack with:
.br: Current branch state for control flow (see$branch)..va: Stack of values.
$val
Runtime value on the stack, which can be either:
A raw atom.
A typed reference.
$branch
Branch state for control flow management:
~: Normal execution (no branch pending).%retr: Return to caller function.%targ: Branch to specific block label.i.%trap: Execution trapped (deterministic crash).%bloq: Blocked waiting for import resolution, containing the$requestdetails and current execution state.
$result
Result of module instantiation or function invocation:
%0: Successful execution with output values and updated$store.%1: Blocked on import$request, containing request details and current state for resumption.%2: Crashed with final$storestate.
$request
Import request types:
%func: Function call with typed argument values.%tabl: Table operation with arguments and specific table instruction.%memo: Memory operation, including vector operations and standard memory instructions.%glob: Global variable.
$shop
List of resolved import $items representing available external dependencies.
$item
Resolved import item containing:
A list of values to push onto the stack when this import is invoked.
Complete module state including memory, tables, and globals that this import provides access to.
Last updated