Missed a file
This commit is contained in:
parent
50b93641f2
commit
fef7e3cd13
@ -4,8 +4,8 @@ use std::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use wasm_ast::node::{
|
use wasm_ast::node::{
|
||||||
Block, Br, BrIf, BrTable, Call, CallIndirect, FuncData, If, LabelType, MemoryGrow, SetGlobal,
|
Block, Br, BrIf, BrTable, Call, CallIndirect, FuncData, If, LabelType, MemoryGrow, MemoryCopy,
|
||||||
SetLocal, SetTemporary, Statement, StoreAt, Terminator,
|
MemoryFill, SetGlobal, SetLocal, SetTemporary, Statement, StoreAt, Terminator,
|
||||||
};
|
};
|
||||||
use wasmparser::ValType;
|
use wasmparser::ValType;
|
||||||
|
|
||||||
@ -301,6 +301,32 @@ impl DriverNoContext for MemoryGrow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl DriverNoContext for MemoryCopy {
|
||||||
|
fn write(&self, w: &mut dyn Write) -> Result<()> {
|
||||||
|
let dst = self.dst();
|
||||||
|
let src = self.src();
|
||||||
|
let size = self.size();
|
||||||
|
|
||||||
|
write!(w, "rt.store.copy(memory_at_0, {dst}, {src}, ")?;
|
||||||
|
size.write(w)?;
|
||||||
|
write!(w, ")")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl DriverNoContext for MemoryFill {
|
||||||
|
fn write(&self, w: &mut dyn Write) -> Result<()> {
|
||||||
|
let mem = self.mem();
|
||||||
|
let value = self.value();
|
||||||
|
let n = self.n();
|
||||||
|
|
||||||
|
write!(w, "rt.store.copy(memory_at_0, {mem}, ")?;
|
||||||
|
value.write(w)?;
|
||||||
|
write!(w, ", ")?;
|
||||||
|
n.write(w)?;
|
||||||
|
write!(w, ")")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn write_stat(stat: &dyn DriverNoContext, mng: &mut Manager, w: &mut dyn Write) -> Result<()> {
|
fn write_stat(stat: &dyn DriverNoContext, mng: &mut Manager, w: &mut dyn Write) -> Result<()> {
|
||||||
indentation!(mng, w)?;
|
indentation!(mng, w)?;
|
||||||
stat.write(w)?;
|
stat.write(w)?;
|
||||||
@ -320,6 +346,8 @@ impl Driver for Statement {
|
|||||||
Self::SetGlobal(s) => write_stat(s, mng, w),
|
Self::SetGlobal(s) => write_stat(s, mng, w),
|
||||||
Self::StoreAt(s) => write_stat(s, mng, w),
|
Self::StoreAt(s) => write_stat(s, mng, w),
|
||||||
Self::MemoryGrow(s) => write_stat(s, mng, w),
|
Self::MemoryGrow(s) => write_stat(s, mng, w),
|
||||||
|
Self::MemoryCopy(s) => write_stat(s, mng, w),
|
||||||
|
Self::MemoryFill(s) => write_stat(s, mng, w),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user