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

Method visit_ref_is_null

winch/codegen/src/visitor.rs:2137–2147  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

2135 }
2136
2137 fn visit_ref_is_null(&mut self) -> Self::Output {
2138 let (zero, size) = match self.env.ptr_type() {
2139 WasmValType::I64 => (RegImm::i64(0), OperandSize::S64),
2140 WasmValType::I32 => (RegImm::i32(0), OperandSize::S32),
2141 _ => bail!(CodeGenError::unsupported_wasm_type()),
2142 };
2143 self.context.unop(self.masm, |masm, reg| {
2144 masm.cmp_with_set(writable!(reg), zero, IntCmpKind::Eq, size)?;
2145 Ok(TypedReg::i32(reg))
2146 })
2147 }
2148
2149 fn visit_ref_func(&mut self, function_index: u32) -> Self::Output {
2150 let ref_func = self.env.builtins.ref_func::<M::ABI>()?;

Callers

nothing calls this directly

Calls 5

i64Function · 0.85
OkFunction · 0.85
unopMethod · 0.80
ptr_typeMethod · 0.45
cmp_with_setMethod · 0.45

Tested by

no test coverage detected