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 b8a76822cf
commit bdc95990d4
8 changed files with 74 additions and 30 deletions

View File

@@ -158,6 +158,11 @@ impl Context {
try!(self.map.rewrite_values(&mut data.varargs, loc));
}
InstructionData::IndirectCall { ref mut data, .. } => {
try!(self.map.rewrite_value(&mut data.arg, loc));
try!(self.map.rewrite_values(&mut data.varargs, loc));
}
InstructionData::Return { ref mut data, .. } => {
try!(self.map.rewrite_values(&mut data.varargs, loc));
}
@@ -1171,6 +1176,12 @@ impl<'a> Parser<'a> {
args: [lhs, rhs],
}
}
InstructionFormat::Call => {
unimplemented!();
}
InstructionFormat::IndirectCall => {
unimplemented!();
}
InstructionFormat::Return => {
let args = try!(self.parse_value_list());
InstructionData::Return {
@@ -1190,9 +1201,6 @@ impl<'a> Parser<'a> {
table: table,
}
}
InstructionFormat::Call => {
unimplemented!();
}
})
}
}