mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-25 22:51:32 +00:00
clean up (second pass)
This commit is contained in:
@ -39,7 +39,7 @@ impl Drop for InstanceInner {
|
|||||||
pub struct Instance {
|
pub struct Instance {
|
||||||
module: Arc<ModuleInner>,
|
module: Arc<ModuleInner>,
|
||||||
inner: Box<InstanceInner>,
|
inner: Box<InstanceInner>,
|
||||||
|
#[allow(dead_code)]
|
||||||
import_object: ImportObject,
|
import_object: ImportObject,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +72,8 @@ pub fn compile_with(
|
|||||||
.map(|inner| module::Module::new(Arc::new(inner)))
|
.map(|inner| module::Module::new(Arc::new(inner)))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The same as `compile_with` but takes a symbol map for use with debugging
|
/// The same as `compile_with` but changes the compiler behavior
|
||||||
|
/// with the values in the `CompilerConfig`
|
||||||
pub fn compile_with_config(
|
pub fn compile_with_config(
|
||||||
wasm: &[u8],
|
wasm: &[u8],
|
||||||
compiler: &dyn backend::Compiler,
|
compiler: &dyn backend::Compiler,
|
||||||
|
@ -57,6 +57,7 @@ pub struct ModuleInfo {
|
|||||||
pub namespace_table: StringTable<NamespaceIndex>,
|
pub namespace_table: StringTable<NamespaceIndex>,
|
||||||
pub name_table: StringTable<NameIndex>,
|
pub name_table: StringTable<NameIndex>,
|
||||||
|
|
||||||
|
/// Symbol information from emscripten
|
||||||
pub em_symbol_map: Option<HashMap<u32, String>>,
|
pub em_symbol_map: Option<HashMap<u32, String>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,6 +159,7 @@ impl Ctx {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Gives access to the emscripten symbol map, used for debugging
|
||||||
pub unsafe fn borrow_symbol_map(&self) -> &Option<HashMap<u32, String>> {
|
pub unsafe fn borrow_symbol_map(&self) -> &Option<HashMap<u32, String>> {
|
||||||
&(*self.module).info.em_symbol_map
|
&(*self.module).info.em_symbol_map
|
||||||
}
|
}
|
||||||
|
@ -129,6 +129,8 @@ pub fn compile(wasm: &[u8]) -> error::CompileResult<Module> {
|
|||||||
wasmer_runtime_core::compile_with(&wasm[..], default_compiler())
|
wasmer_runtime_core::compile_with(&wasm[..], default_compiler())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The same as `compile` but takes a `CompilerConfig` for the purpose of
|
||||||
|
/// changing the compiler's behavior
|
||||||
pub fn compile_with_config(
|
pub fn compile_with_config(
|
||||||
wasm: &[u8],
|
wasm: &[u8],
|
||||||
compiler_config: CompilerConfig,
|
compiler_config: CompilerConfig,
|
||||||
|
@ -77,6 +77,8 @@ pub fn compile(buffer_source: &[u8]) -> Result<Module> {
|
|||||||
Ok(module)
|
Ok(module)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The same as `compile` but takes a `CompilerConfig` for the purpose of
|
||||||
|
/// changing the compiler's behavior
|
||||||
pub fn compile_with_config(
|
pub fn compile_with_config(
|
||||||
buffer_source: &[u8],
|
buffer_source: &[u8],
|
||||||
compiler_config: CompilerConfig,
|
compiler_config: CompilerConfig,
|
||||||
|
Reference in New Issue
Block a user