(&mut self)
| 296 | } |
| 297 | |
| 298 | fn visit_else(&mut self) -> Self::Output { |
| 299 | let last_if = self.ctx_stack.last().filter(|ctx| matches!(ctx.kind, BlockKind::If)); |
| 300 | if let Some(cond_jump_ip) = last_if.map(|ctx| ctx.branch_jumps[0]) { |
| 301 | let jump_ip = self.instructions.len(); |
| 302 | self.instructions.push(Instruction::Jump(0)); |
| 303 | if let Some(ctx) = self.ctx_stack.last_mut() { |
| 304 | ctx.has_else = true; |
| 305 | ctx.branch_jumps.push(jump_ip); |
| 306 | self.patch_jump_if_zero(cond_jump_ip, self.instructions.len()); |
| 307 | if !matches!(self.instructions.last(), Some(Instruction::Nop | Instruction::MergeBarrier)) { |
| 308 | self.instructions.push(Instruction::MergeBarrier); // prevent superinstructions from merging across block boundaries |
| 309 | } |
| 310 | }; |
| 311 | }; |
| 312 | } |
| 313 | |
| 314 | fn visit_end(&mut self) -> Self::Output { |
| 315 | if let Some(ctx) = self.ctx_stack.pop() { |
nothing calls this directly
no test coverage detected