mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-24 22:21:32 +00:00
clean up implementation
This commit is contained in:
@ -4,6 +4,7 @@ use wasmer_runtime::{
|
||||
error::{CallResult, Result},
|
||||
ImportObject, Instance, Module,
|
||||
};
|
||||
use wasmer_runtime_core::backend::CompilerConfig;
|
||||
use wasmer_runtime_core::types::Value;
|
||||
|
||||
use wasmer_emscripten::{is_emscripten_module, run_emscripten_instance};
|
||||
@ -42,7 +43,7 @@ pub fn instantiate(buffer_source: &[u8], import_object: ImportObject) -> Result<
|
||||
let module = compile(&buffer_source[..])?;
|
||||
|
||||
debug!("webassembly - instantiating");
|
||||
let instance = module.instantiate(&import_object, None)?;
|
||||
let instance = module.instantiate(&import_object)?;
|
||||
|
||||
debug!("webassembly - instance created");
|
||||
Ok(ResultObject {
|
||||
@ -76,6 +77,14 @@ pub fn compile(buffer_source: &[u8]) -> Result<Module> {
|
||||
Ok(module)
|
||||
}
|
||||
|
||||
pub fn compile_with_config(
|
||||
buffer_source: &[u8],
|
||||
compiler_config: CompilerConfig,
|
||||
) -> Result<Module> {
|
||||
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(
|
||||
|
Reference in New Issue
Block a user