MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / bind_exit_label

Method bind_exit_label

winch/codegen/src/codegen/control.rs:597–611  ·  view source on GitHub ↗

Binds the exit label of the control stack frame.

(&self, masm: &mut M)

Source from the content-addressed store, hash-verified

595
596 /// Binds the exit label of the control stack frame.
597 pub fn bind_exit_label<M: MacroAssembler>(&self, masm: &mut M) -> Result<()> {
598 use ControlStackFrame::*;
599 match self {
600 // We use an explicit label to track the exit of an if block. In case there's no
601 // else, we bind the if's continuation block to make sure that any jumps from the if
602 // condition are reachable and we bind the explicit exit label as well to ensure that any
603 // branching instructions are able to correctly reach the block's end.
604 If { cont, .. } => masm.bind(*cont)?,
605 _ => {}
606 }
607 if let Some(label) = self.exit_label() {
608 masm.bind(*label)?;
609 }
610 Ok(())
611 }
612
613 /// Returns the continuation label of the current control stack frame.
614 pub fn label(&self) -> &MachLabel {

Callers 1

bind_endMethod · 0.80

Calls 3

OkFunction · 0.85
exit_labelMethod · 0.80
bindMethod · 0.45

Tested by

no test coverage detected