-
Couldn't load subscription status.
- Fork 14
Description
Since Wasm does not support machine-level function pointers and instead relies on function tables (table) and indirect calls (call_indirect), it is not possible to perform native-style function pointer jumps in Wasmtime.
Currently, each grate executes by name-based matching. For example, a system call such as open is matched to an exported function open_grate in the corresponding module.
In the redesigned scheme, all grates will expose a unified entry function (with the same name across modules). During handler registration, each grate records the corresponding function pointer from within the module (as seen from the C program’s perspective, but internally represented as a Wasm function reference). When Wasmtime enters the module through the unified entry function, it dispatches execution to the registered handler based on this function pointer.