wasmer_compiler/module.rs
1use crate::lib::std::sync::Arc;
2use wasmer_types::entity::PrimaryMap;
3use wasmer_types::{Features, MemoryIndex, ModuleInfo, TableIndex};
4use wasmer_vm::{MemoryStyle, TableStyle};
5
6/// The required info for compiling a module.
7///
8/// This differs from [`ModuleInfo`] because it have extra info only
9/// possible after translation (such as the features used for compiling,
10/// or the `MemoryStyle` and `TableStyle`).
11#[derive(Debug, PartialEq, Eq, rkyv::Serialize, rkyv::Deserialize, rkyv::Archive)]
12pub struct CompileModuleInfo {
13 /// The features used for compiling the module
14 pub features: Features,
15 /// The module information
16 pub module: Arc<ModuleInfo>,
17 /// The memory styles used for compiling.
18 ///
19 /// The compiler will emit the most optimal code based
20 /// on the memory style (static or dynamic) chosen.
21 pub memory_styles: PrimaryMap<MemoryIndex, MemoryStyle>,
22 /// The table plans used for compiling.
23 pub table_styles: PrimaryMap<TableIndex, TableStyle>,
24}