From 53c576fe48ea32eaf7668030f5a848e69cb68786 Mon Sep 17 00:00:00 2001 From: Lachlan Sneff Date: Mon, 22 Apr 2019 16:54:58 -0700 Subject: [PATCH] remove run_instance function --- src/webassembly.rs | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/src/webassembly.rs b/src/webassembly.rs index 354136ead7e..3d051f0785a 100644 --- a/src/webassembly.rs +++ b/src/webassembly.rs @@ -77,40 +77,3 @@ pub fn compile(buffer_source: &[u8]) -> Result { let module = runtime::compile(buffer_source)?; Ok(module) } - -// /// The same as `compile` but takes a `CompilerConfig` for the purpose of -// /// changing the compiler's behavior -// pub fn compile_with_config_with( -// buffer_source: &[u8], -// compiler_config: CompilerConfig, -// ) -> Result { -// let module = runtime::compile_with_config(buffer_source, compiler_config)?; -// Ok(module) -// } - -/// Performs common instance operations needed when an instance is first run -/// including data setup, handling arguments and calling a main function -pub fn run_instance( - module: &Module, - instance: &mut Instance, - abi: InstanceABI, - path: &str, - args: Vec<&str>, -) -> CallResult<()> { - match abi { - InstanceABI::Emscripten => { - run_emscripten_instance(module, instance, path, args)?; - } - InstanceABI::WASI => { - instance.call("_start", &[])?; - } - InstanceABI::None => { - let args: Vec = args - .into_iter() - .map(|x| Value::I32(x.parse().unwrap())) - .collect(); - instance.call("main", &args)?; - } - } - Ok(()) -}