Skip to content
Snippets Groups Projects
Commit 997bb60d authored by Cecile Tonglet's avatar Cecile Tonglet
Browse files

Revert "wasmtime"

This reverts commit 79f4a2a1.
parent 79f4a2a1
Branches
No related merge requests found
...@@ -199,7 +199,7 @@ pub fn create_wasm_runtime_with_code( ...@@ -199,7 +199,7 @@ pub fn create_wasm_runtime_with_code(
.map(|runtime| -> Box<dyn WasmRuntime> { Box::new(runtime) }), .map(|runtime| -> Box<dyn WasmRuntime> { Box::new(runtime) }),
#[cfg(feature = "wasmtime")] #[cfg(feature = "wasmtime")]
WasmExecutionMethod::Compiled => WasmExecutionMethod::Compiled =>
sc_executor_wasmtime::create_instance(code, heap_pages, host_functions, enable_stub) sc_executor_wasmtime::create_instance(code, heap_pages, host_functions)
.map(|runtime| -> Box<dyn WasmRuntime> { Box::new(runtime) }), .map(|runtime| -> Box<dyn WasmRuntime> { Box::new(runtime) }),
} }
} }
......
...@@ -56,10 +56,6 @@ pub struct WasmtimeRuntime { ...@@ -56,10 +56,6 @@ pub struct WasmtimeRuntime {
heap_pages: u32, heap_pages: u32,
/// The host functions registered for this instance. /// The host functions registered for this instance.
host_functions: Vec<&'static dyn Function>, host_functions: Vec<&'static dyn Function>,
/// Enable STUB for function called that are missing
enable_stub: bool,
/// List of missing functions detected during function resolution
missing_functions: HashMap<usize, String>,
} }
impl WasmRuntime for WasmtimeRuntime { impl WasmRuntime for WasmtimeRuntime {
...@@ -87,8 +83,6 @@ impl WasmRuntime for WasmtimeRuntime { ...@@ -87,8 +83,6 @@ impl WasmRuntime for WasmtimeRuntime {
method, method,
data, data,
self.heap_pages, self.heap_pages,
self.enable_stub,
&self.missing_functions,
) )
} }
} }
...@@ -112,7 +106,6 @@ pub fn create_instance( ...@@ -112,7 +106,6 @@ pub fn create_instance(
code: &[u8], code: &[u8],
heap_pages: u64, heap_pages: u64,
host_functions: Vec<&'static dyn Function>, host_functions: Vec<&'static dyn Function>,
enable_stub: bool,
) -> std::result::Result<WasmtimeRuntime, WasmError> { ) -> std::result::Result<WasmtimeRuntime, WasmError> {
let global_exports = Rc::new(RefCell::new(HashMap::new())); let global_exports = Rc::new(RefCell::new(HashMap::new()));
...@@ -121,7 +114,6 @@ pub fn create_instance( ...@@ -121,7 +114,6 @@ pub fn create_instance(
instantiate_env_module(Rc::clone(&global_exports), compiler, &host_functions)?; instantiate_env_module(Rc::clone(&global_exports), compiler, &host_functions)?;
let mut compiler = new_compiler(CompilationStrategy::Cranelift)?; let mut compiler = new_compiler(CompilationStrategy::Cranelift)?;
// let (compiled_module, context, missing_functions) = create_compiled_unit(code, &host_functions, enable_stub)?;
let compiled_module = create_compiled_unit( let compiled_module = create_compiled_unit(
&mut compiler, &mut compiler,
code, code,
...@@ -159,8 +151,6 @@ pub fn create_instance( ...@@ -159,8 +151,6 @@ pub fn create_instance(
host_functions, host_functions,
global_exports, global_exports,
env_instance, env_instance,
enable_stub,
missing_functions,
}) })
} }
...@@ -170,8 +160,7 @@ fn create_compiled_unit( ...@@ -170,8 +160,7 @@ fn create_compiled_unit(
resolver: &mut dyn Resolver, resolver: &mut dyn Resolver,
global_exports: Rc<RefCell<HashMap<String, Option<Export>>>>, global_exports: Rc<RefCell<HashMap<String, Option<Export>>>>,
host_functions: &[&'static dyn Function], host_functions: &[&'static dyn Function],
enable_stub: bool, ) -> std::result::Result<CompiledModule, WasmError> {
) -> std::result::Result<(CompiledModule, HashMap<usize, String>), WasmError> {
let debug_info = false; let debug_info = false;
let module = CompiledModule::new(compiler, code, resolver, global_exports, debug_info) let module = CompiledModule::new(compiler, code, resolver, global_exports, debug_info)
.map_err(|e| WasmError::Other(format!("module compile error: {}", e)))?; .map_err(|e| WasmError::Other(format!("module compile error: {}", e)))?;
...@@ -188,8 +177,6 @@ fn call_method( ...@@ -188,8 +177,6 @@ fn call_method(
method: &str, method: &str,
data: &[u8], data: &[u8],
heap_pages: u32, heap_pages: u32,
enable_stub: bool,
missing_functions: &HashMap<usize, String>,
) -> Result<Vec<u8>> { ) -> Result<Vec<u8>> {
// Old exports get clobbered in `InstanceHandle::new` if we don't explicitly remove them first. // Old exports get clobbered in `InstanceHandle::new` if we don't explicitly remove them first.
// //
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment