This commit is contained in:
Lachlan Sneff 2019-04-09 16:07:09 -07:00 committed by Syrus
parent cc656b26a9
commit 782bb384ad
3 changed files with 22 additions and 0 deletions

View File

@ -18,6 +18,7 @@ use wasmer_runtime_core::{
memory::MemoryType,
module::{ModuleInfo, ModuleInner},
structures::{Map, TypedIndex},
typed_func::Wasm,
types::{
FuncIndex, FuncSig, ImportedMemoryIndex, LocalFuncIndex, LocalGlobalIndex,
LocalMemoryIndex, LocalOrImport, MemoryIndex, SigIndex, Type, Value,
@ -459,6 +460,10 @@ impl ProtectedCaller for X64ExecutionContext {
})
}
fn get_wasm_trampoline(&self, _module: &ModuleInner, _sig_index: SigIndex) -> Option<Wasm> {
unimplemented!()
}
fn get_early_trapper(&self) -> Box<dyn UserTrapper> {
pub struct Trapper;

View File

@ -20,4 +20,11 @@ impl VarArgs {
unsafe impl WasmExternType for VarArgs {
const TYPE: Type = Type::I32;
fn to_bits(self) -> u64 {
self.pointer as u64
}
fn from_bits(n: u64) -> Self {
Self { pointer: n as u32 }
}
}

View File

@ -72,6 +72,16 @@ impl<T: Copy + ValueType> WasmPtr<T, Array> {
unsafe impl<T: Copy, Ty> WasmExternType for WasmPtr<T, Ty> {
const TYPE: Type = Type::I32;
fn to_bits(self) -> u64 {
self.offset as u64
}
fn from_bits(n: u64) -> Self {
Self {
offset: n as u32,
_phantom: PhantomData,
}
}
}
unsafe impl<T: Copy, Ty> ValueType for WasmPtr<T, Ty> {}