From 9c85fa9c3a2066ce851af53d7019e6a25a45af3b Mon Sep 17 00:00:00 2001 From: Henry Gressmann Date: Sun, 30 Jun 2024 19:19:45 +0200 Subject: chore: restructure runtime and reduce build dependencies Signed-off-by: Henry Gressmann --- benchmarks/benches/util/mod.rs | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 benchmarks/benches/util/mod.rs (limited to 'benchmarks/benches/util') diff --git a/benchmarks/benches/util/mod.rs b/benchmarks/benches/util/mod.rs deleted file mode 100644 index 2961046..0000000 --- a/benchmarks/benches/util/mod.rs +++ /dev/null @@ -1,29 +0,0 @@ -#![allow(dead_code)] - -pub fn tinywasm(wasm: &[u8]) -> (tinywasm::Store, tinywasm::ModuleInstance) { - use tinywasm::*; - let module = Module::parse_bytes(wasm).expect("Module::parse_bytes"); - let mut store = Store::default(); - let imports = Imports::default(); - let instance = ModuleInstance::instantiate(&mut store, module, Some(imports)).expect("instantiate"); - (store, instance) -} - -pub fn wasmi(wasm: &[u8]) -> (wasmi::Module, wasmi::Store<()>, wasmi::Linker<()>) { - use wasmi::*; - let engine = Engine::default(); - let module = wasmi::Module::new(&engine, wasm).expect("wasmi::Module::new"); - let store = Store::new(&engine, ()); - let linker = >::new(&engine); - (module, store, linker) -} - -pub fn wasmer(wasm: &[u8]) -> (wasmer::Store, wasmer::Instance) { - use wasmer::*; - let compiler = Singlepass::default(); - let mut store = Store::new(compiler); - let import_object = imports! {}; - let module = Module::new(&store, wasm).expect("wasmer::Module::new"); - let instance = Instance::new(&mut store, &module, &import_object).expect("Instance::new"); - (store, instance) -} -- cgit v1.3.1