Truncates the value stack to the specified target. This function is intended to only be used when restoring the code generation's reachability state, when handling an unreachable end or else.
(&mut self, target: usize)
| 807 | /// generation's reachability state, when handling an unreachable end or |
| 808 | /// else. |
| 809 | pub fn truncate_stack_to(&mut self, target: usize) -> Result<()> { |
| 810 | if self.stack.len() > target { |
| 811 | self.drop_last(self.stack.len() - target, |regalloc, val| match val { |
| 812 | Val::Reg(tr) => Ok(regalloc.free(tr.reg)), |
| 813 | _ => Ok(()), |
| 814 | }) |
| 815 | } else { |
| 816 | Ok(()) |
| 817 | } |
| 818 | } |
| 819 | |
| 820 | /// Load the [VMContext] pointer into the designated pinned register. |
| 821 | pub fn load_vmctx<M>(&mut self, masm: &mut M) -> Result<()> |