MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / new

Method new

crates/fuzzing/src/oracles/diff_wasmi.rs:13–41  ·  view source on GitHub ↗
(config: &mut Config)

Source from the content-addressed store, hash-verified

11
12impl WasmiEngine {
13 pub(crate) fn new(config: &mut Config) -> Self {
14 let config = &mut config.module_config.config;
15 // Force generated Wasm modules to never have features that Wasmi doesn't support.
16 config.relaxed_simd_enabled = false;
17 config.threads_enabled = false;
18 config.exceptions_enabled = false;
19 config.gc_enabled = false;
20
21 let mut wasmi_config = wasmi::Config::default();
22 wasmi_config
23 .consume_fuel(false)
24 .floats(true)
25 .wasm_mutable_global(true)
26 .wasm_sign_extension(config.sign_extension_ops_enabled)
27 .wasm_saturating_float_to_int(config.saturating_float_to_int_enabled)
28 .wasm_multi_value(config.multi_value_enabled)
29 .wasm_bulk_memory(config.bulk_memory_enabled)
30 .wasm_reference_types(config.reference_types_enabled)
31 .wasm_tail_call(config.tail_call_enabled)
32 .wasm_multi_memory(config.max_memories > 1)
33 .wasm_extended_const(config.extended_const_enabled)
34 .wasm_custom_page_sizes(config.custom_page_sizes_enabled)
35 .wasm_memory64(config.memory64_enabled)
36 .wasm_simd(config.simd_enabled)
37 .wasm_wide_arithmetic(config.wide_arithmetic_enabled);
38 Self {
39 engine: wasmi::Engine::new(&wasmi_config),
40 }
41 }
42
43 fn trap_code(&self, err: &Error) -> Option<wasmi::TrapCode> {
44 let err = err.downcast_ref::<wasmi::Error>()?;

Callers

nothing calls this directly

Calls 13

wasm_extended_constMethod · 0.80
floatsMethod · 0.80
newFunction · 0.50
wasm_wide_arithmeticMethod · 0.45
wasm_simdMethod · 0.45
wasm_memory64Method · 0.45
wasm_multi_memoryMethod · 0.45
wasm_tail_callMethod · 0.45
wasm_reference_typesMethod · 0.45
wasm_bulk_memoryMethod · 0.45
wasm_multi_valueMethod · 0.45

Tested by

no test coverage detected