mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 08:11:12 +00:00
wasm_interp: implement call
and return
instructions
This commit is contained in:
parent
57aa3aafd8
commit
972d9dbb19
5 changed files with 75 additions and 32 deletions
|
@ -78,10 +78,17 @@ impl<'a> ExecutionState<'a> {
|
|||
todo!("{:?}", op_code);
|
||||
}
|
||||
RETURN => {
|
||||
todo!("{:?}", op_code);
|
||||
self.program_counter = self.call_stack.pop_frame() as usize;
|
||||
}
|
||||
CALL => {
|
||||
todo!("{:?}", op_code);
|
||||
let index = self.fetch_immediate_u32(module) as usize;
|
||||
let return_addr = self.program_counter as u32;
|
||||
self.program_counter = module.code.function_offsets[index] as usize;
|
||||
self.call_stack.push_frame(
|
||||
return_addr,
|
||||
&module.code.bytes,
|
||||
&mut self.program_counter,
|
||||
)
|
||||
}
|
||||
CALLINDIRECT => {
|
||||
todo!("{:?}", op_code);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue