mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-05 02:20:19 +00:00
environment fully working
This commit is contained in:
parent
ac9edf39e6
commit
8bd6657e84
@ -417,6 +417,7 @@ impl<'environment> FuncEnvironmentTrait for FuncEnvironment<'environment> {
|
||||
fn make_indirect_sig(&mut self, func: &mut ir::Function, index: SignatureIndex) -> ir::SigRef {
|
||||
// A real implementation would probably change the calling convention and add `vmctx` and
|
||||
// signature index arguments.
|
||||
// func.import_signature(self.module.signatures[index].clone())
|
||||
func.import_signature(self.vmctx_sig(index))
|
||||
}
|
||||
|
||||
|
@ -152,6 +152,11 @@ impl Instance {
|
||||
pub fn memories(&self) -> Arc<Vec<LinearMemory>> {
|
||||
self.memories.clone()
|
||||
}
|
||||
|
||||
// pub fn start_func(&self) -> extern fn(&VmCtx) {
|
||||
// self.start_func
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
impl Clone for Instance {
|
||||
|
@ -67,8 +67,13 @@ pub struct ImportObject {
|
||||
/// Errors:
|
||||
/// If the operation fails, the Result rejects with a
|
||||
/// WebAssembly.CompileError, WebAssembly.LinkError, or
|
||||
/// WebAssembly.RuntimeError, depending on the cause of the failure.
|
||||
/// WebAssembly.RuntimeError, depending on the cause of the failure.
|
||||
pub fn instantiate(buffer_source: Vec<u8>, import_object: Option<ImportObject>) -> Result<ModuleInstance, ErrorKind> {
|
||||
// TODO: This should be automatically validated when creating the ModuleInstance
|
||||
if !validate(&buffer_source) {
|
||||
return Err(ErrorKind::CompileError("Module not valid".to_string()));
|
||||
}
|
||||
|
||||
let flags = Flags::new(settings::builder());
|
||||
let return_mode = ReturnMode::NormalReturns;
|
||||
let mut environ =
|
||||
|
Loading…
Reference in New Issue
Block a user