codegen: More opcodes

This commit is contained in:
losfair
2019-02-14 00:53:06 +08:00
parent 43df3dd546
commit 7df7204e4b
2 changed files with 49 additions and 2 deletions

View File

@ -2,9 +2,11 @@ use wasmparser::{Operator, Type as WpType};
pub trait ModuleCodeGenerator<FCG: FunctionCodeGenerator> {
fn next_function(&mut self) -> Result<&mut FCG, CodegenError>;
fn finalize(&mut self) -> Result<(), CodegenError>;
}
pub trait FunctionCodeGenerator {
fn feed_return(&mut self, ty: WpType) -> Result<(), CodegenError>;
fn feed_param(&mut self, ty: WpType) -> Result<(), CodegenError>;
fn feed_local(&mut self, ty: WpType, n: usize) -> Result<(), CodegenError>;
fn begin_body(&mut self) -> Result<(), CodegenError>;