Add call and call_indirect instructions.

Add a new IndirectCall instruction format which has a value callee as
well as the call arguments.

Define call and call_indirect instructions.
This commit is contained in:
Jakob Stoklund Olesen
2016-10-18 09:48:05 -07:00
parent 8055ac681c
commit e4e1c30f87
8 changed files with 74 additions and 30 deletions

View File

@@ -199,7 +199,10 @@ fn write_instruction(w: &mut Write,
Jump { ref data, .. } => writeln!(w, " {}", data),
Branch { ref data, .. } => writeln!(w, " {}", data),
BranchTable { arg, table, .. } => writeln!(w, " {}, {}", arg, table),
Call { ref data, .. } => writeln!(w, " {}", data),
Call { ref data, .. } => writeln!(w, " {}({})", data.func_ref, data.varargs),
IndirectCall { ref data, .. } => {
writeln!(w, " {}, {}({})", data.sig_ref, data.arg, data.varargs)
}
Return { ref data, .. } => {
if data.varargs.is_empty() {
writeln!(w, "")