MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / r#if

Method r#if

winch/codegen/src/codegen/control.rs:260–275  ·  view source on GitHub ↗

Returns [`ControlStackFrame`] for an if.

(
        sig: BlockSig,
        masm: &mut M,
        context: &mut CodeGenContext<Emission>,
    )

Source from the content-addressed store, hash-verified

258impl ControlStackFrame {
259 /// Returns [`ControlStackFrame`] for an if.
260 pub fn r#if<M: MacroAssembler>(
261 sig: BlockSig,
262 masm: &mut M,
263 context: &mut CodeGenContext<Emission>,
264 ) -> Result<Self> {
265 let mut control = Self::If {
266 cont: masm.get_label()?,
267 exit: masm.get_label()?,
268 sig,
269 reachable: context.reachable,
270 stack_state: Default::default(),
271 };
272
273 control.emit(masm, context)?;
274 Ok(control)
275 }
276
277 /// Returns [`ControlStackFrame`] for a block.
278 pub fn block<M: MacroAssembler>(

Callers

nothing calls this directly

Calls 3

OkFunction · 0.85
get_labelMethod · 0.45
emitMethod · 0.45

Tested by

no test coverage detected