mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-24 22:21:32 +00:00
Add importable memories and dynamic memories
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
use crate::call::HandlerData;
|
||||
use crate::libcalls;
|
||||
use crate::relocation::{
|
||||
LocalTrapSink, Reloc, RelocSink, Relocation, RelocationType, TrapSink, VmCall,
|
||||
LocalTrapSink, Reloc, RelocSink, Relocation, RelocationType, TrapSink, VmCall, VmCallKind,
|
||||
};
|
||||
use byteorder::{ByteOrder, LittleEndian};
|
||||
use cranelift_codegen::{ir, isa, Context};
|
||||
@ -133,14 +133,38 @@ impl FuncResolverBuilder {
|
||||
msg: format!("unexpected intrinsic: {}", name),
|
||||
})?,
|
||||
RelocationType::VmCall(vmcall) => match vmcall {
|
||||
VmCall::LocalStaticMemoryGrow => vmcalls::local_static_memory_grow as _,
|
||||
VmCall::LocalStaticMemorySize => vmcalls::local_static_memory_size as _,
|
||||
VmCall::ImportedStaticMemoryGrow => {
|
||||
vmcalls::imported_static_memory_grow as _
|
||||
}
|
||||
VmCall::ImportedStaticMemorySize => {
|
||||
vmcalls::imported_static_memory_size as _
|
||||
}
|
||||
VmCall::Local(kind) => match kind {
|
||||
VmCallKind::StaticMemoryGrow => vmcalls::local_static_memory_grow as _,
|
||||
VmCallKind::StaticMemorySize => vmcalls::local_static_memory_size as _,
|
||||
|
||||
VmCallKind::SharedStaticMemoryGrow => unimplemented!(),
|
||||
VmCallKind::SharedStaticMemorySize => unimplemented!(),
|
||||
|
||||
VmCallKind::DynamicMemoryGrow => {
|
||||
vmcalls::local_dynamic_memory_grow as _
|
||||
}
|
||||
VmCallKind::DynamicMemorySize => {
|
||||
vmcalls::local_dynamic_memory_size as _
|
||||
}
|
||||
},
|
||||
VmCall::Import(kind) => match kind {
|
||||
VmCallKind::StaticMemoryGrow => {
|
||||
vmcalls::imported_static_memory_grow as _
|
||||
}
|
||||
VmCallKind::StaticMemorySize => {
|
||||
vmcalls::imported_static_memory_size as _
|
||||
}
|
||||
|
||||
VmCallKind::SharedStaticMemoryGrow => unimplemented!(),
|
||||
VmCallKind::SharedStaticMemorySize => unimplemented!(),
|
||||
|
||||
VmCallKind::DynamicMemoryGrow => {
|
||||
vmcalls::imported_dynamic_memory_grow as _
|
||||
}
|
||||
VmCallKind::DynamicMemorySize => {
|
||||
vmcalls::imported_dynamic_memory_size as _
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user