Cranelift: Introduce support for return_call in the interpreter (#5697)

Co-authored-by: Jamey Sharp <jsharp@fastly.com>
This commit is contained in:
Nick Fitzgerald
2023-02-03 15:53:54 -08:00
committed by GitHub
parent 72c8513411
commit e18d4cb711
3 changed files with 154 additions and 70 deletions

View File

@@ -125,6 +125,11 @@ impl<'a> Interpreter<'a> {
.set_all(function.dfg.inst_results(inst), returned_arguments);
maybe_inst = layout.next_inst(inst)
}
ControlFlow::ReturnCall(callee, args) => {
self.state.pop_frame();
let rets = self.call(callee, &args)?.unwrap_return();
return Ok(ControlFlow::Return(rets.into()));
}
ControlFlow::Return(returned_values) => {
self.state.pop_frame();
return Ok(ControlFlow::Return(returned_values));