MCPcopy Create free account
hub / github.com/explodingcamera/tinywasm / visit_end

Method visit_end

crates/parser/src/visit.rs:314–323  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

312 }
313
314 fn visit_end(&mut self) -> Self::Output {
315 if let Some(ctx) = self.ctx_stack.pop() {
316 self.patch_end_jumps(ctx, self.instructions.len());
317 if !matches!(self.instructions.last(), Some(Instruction::Nop | Instruction::MergeBarrier)) {
318 self.instructions.push(Instruction::MergeBarrier); // prevent superinstructions from merging across block boundaries
319 }
320 } else {
321 self.instructions.push(Instruction::Return);
322 }
323 }
324
325 fn visit_br(&mut self, depth: u32) -> Self::Output {
326 self.emit_dropkeep_to_label(depth);

Callers

nothing calls this directly

Calls 4

popMethod · 0.80
patch_end_jumpsMethod · 0.80
lenMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected