pub struct Tunables {Show 21 fields
pub collector: Option<Collector>,
pub memory_reservation: u64,
pub memory_guard_size: u64,
pub memory_reservation_for_growth: u64,
pub generate_native_debuginfo: bool,
pub parse_wasm_debuginfo: bool,
pub consume_fuel: bool,
pub epoch_interruption: bool,
pub memory_may_move: bool,
pub guard_before_linear_memory: bool,
pub table_lazy_init: bool,
pub generate_address_map: bool,
pub debug_adapter_modules: bool,
pub relaxed_simd_deterministic: bool,
pub winch_callable: bool,
pub signals_based_traps: bool,
pub memory_init_cow: bool,
pub inlining: bool,
pub inlining_intra_module: IntraModuleInlining,
pub inlining_small_callee_size: u32,
pub inlining_sum_size_threshold: u32,
}Expand description
Tunable parameters for WebAssembly compilation.
Fields§
§collector: Option<Collector>The garbage collector implementation to use, which implies the layout of GC objects and barriers that must be emitted in Wasm code.
memory_reservation: u64Initial size, in bytes, to be allocated for linear memories.
memory_guard_size: u64The size, in bytes, of the guard page region for linear memories.
memory_reservation_for_growth: u64The size, in bytes, to allocate at the end of a relocated linear memory for growth.
generate_native_debuginfo: boolWhether or not to generate native DWARF debug information.
parse_wasm_debuginfo: boolWhether or not to retain DWARF sections in compiled modules.
consume_fuel: boolWhether or not fuel is enabled for generated code, meaning that fuel will be consumed every time a wasm instruction is executed.
epoch_interruption: boolWhether or not we use epoch-based interruption.
memory_may_move: boolWhether or not linear memories are allowed to be reallocated after initial allocation at runtime.
guard_before_linear_memory: boolWhether or not linear memory allocations will have a guard region at the beginning of the allocation in addition to the end.
table_lazy_init: boolWhether to initialize tables lazily, so that instantiation is fast but indirect calls are a little slower. If false, tables are initialized eagerly from any active element segments that apply to them during instantiation.
generate_address_map: boolIndicates whether an address map from compiled native code back to wasm offsets in the original file is generated.
debug_adapter_modules: boolFlag for the component module whether adapter modules have debug assertions baked into them.
relaxed_simd_deterministic: boolWhether or not lowerings for relaxed simd instructions are forced to be deterministic.
winch_callable: boolWhether or not Wasm functions target the winch abi.
signals_based_traps: boolWhether or not the host will be using native signals (e.g. SIGILL, SIGSEGV, etc) to implement traps.
memory_init_cow: boolWhether CoW images might be used to initialize linear memories.
inlining: boolWhether to enable inlining in Wasmtime’s compilation orchestration or not.
inlining_intra_module: IntraModuleInliningWhether to inline calls within the same core Wasm module or not.
inlining_small_callee_size: u32The size of “small callees” that can be inlined regardless of the caller’s size.
inlining_sum_size_threshold: u32The general size threshold for the sum of the caller’s and callee’s sizes, past which we will generally not inline calls anymore.
Implementations§
Source§impl Tunables
impl Tunables
Sourcepub fn default_host() -> Self
pub fn default_host() -> Self
Returns a Tunables configuration assumed for running code on the host.
Sourcepub fn default_for_target(target: &Triple) -> Result<Self>
pub fn default_for_target(target: &Triple) -> Result<Self>
Returns the default set of tunables for the given target triple.
Sourcepub const fn default_miri() -> Tunables
pub const fn default_miri() -> Tunables
Returns the default set of tunables for running under MIRI.
Sourcepub const fn default_u32() -> Tunables
pub const fn default_u32() -> Tunables
Returns the default set of tunables for running under a 32-bit host.
Sourcepub const fn default_u64() -> Tunables
pub const fn default_u64() -> Tunables
Returns the default set of tunables for running under a 64-bit host.
Sourcepub fn gc_heap_memory_type(&self) -> Memory
pub fn gc_heap_memory_type(&self) -> Memory
Get the GC heap’s memory type, given our configured tunables.