wasmtime_internal_cranelift/func_environ/stack_switching/
mod.rs

1mod control_effect;
2pub(crate) mod fatpointer;
3pub(crate) mod instructions;
4
5pub(crate) mod builtins {
6    macro_rules! define_builtin_accessors {
7        ( $( $name:ident , )* ) => {
8            $(
9                #[inline]
10                pub fn $name(
11                    func_env: &mut crate::func_environ::FuncEnvironment<'_>,
12                    func: &mut crate::ir::Function,
13                ) -> wasmtime_environ::WasmResult<crate::ir::FuncRef> {
14                    #[cfg(feature = "stack-switching")]
15                    {
16                        return Ok(func_env.builtin_functions.$name(func));
17                    }
18
19                    #[cfg(not(feature = "stack-switching"))]
20                    {
21                        let _ = (func, func_env);
22                        return Err(wasmtime_environ::wasm_unsupported!(
23                            "support for Wasm Stack Switching disabled at compile time because the `stack-switching` cargo \
24                             feature was not enabled"
25                        ));
26                    }
27                }
28            )*
29        };
30    }
31
32    define_builtin_accessors! {
33        cont_new,
34        table_grow_cont_obj,
35        table_fill_cont_obj,
36    }
37}