| 1414 | } |
| 1415 | |
| 1416 | fn call_indirect(&mut self, dst: XReg) -> ControlFlow<Done> { |
| 1417 | let return_addr = self.pc.as_ptr(); |
| 1418 | self.state.lr = return_addr.as_ptr(); |
| 1419 | // SAFETY: part of the unsafe contract of the interpreter is only valid |
| 1420 | // bytecode is interpreted, so the jump destination is part of the validity |
| 1421 | // of the bytecode itself. |
| 1422 | unsafe { |
| 1423 | self.pc = UnsafeBytecodeStream::new(NonNull::new_unchecked(self.state[dst].get_ptr())); |
| 1424 | } |
| 1425 | ControlFlow::Continue(()) |
| 1426 | } |
| 1427 | |
| 1428 | fn jump(&mut self, offset: PcRelOffset) -> ControlFlow<Done> { |
| 1429 | self.pc_rel_jump::<crate::Jump>(offset) |