Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bytecodealliance
GitHub Repository: bytecodealliance/wasmtime
Path: blob/main/crates/environ/src/component/compiler.rs
1692 views
1
use crate::component::{AllCallFunc, ComponentTranslation, ComponentTypesBuilder};
2
use crate::{CompiledFunctionBody, FuncKey, Tunables};
3
use anyhow::Result;
4
5
/// Compilation support necessary for components.
6
pub trait ComponentCompiler: Send + Sync {
7
/// Compiles the pieces necessary to create a `VMFuncRef` for the
8
/// `trampoline` specified.
9
///
10
/// Each trampoline is a member of the `Trampoline` enumeration and has a
11
/// unique purpose and is translated differently. See the implementation of
12
/// this trait for Cranelift for more information.
13
fn compile_trampoline(
14
&self,
15
component: &ComponentTranslation,
16
types: &ComponentTypesBuilder,
17
key: FuncKey,
18
tunables: &Tunables,
19
symbol: &str,
20
) -> Result<AllCallFunc<CompiledFunctionBody>>;
21
}
22
23