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

Method decode_from_value

cranelift/codegen/src/ir/instructions.rs:234–244  ·  view source on GitHub ↗

Decode a raw `Value` encoding of this block argument.

(v: Value)

Source from the content-addressed store, hash-verified

232
233 /// Decode a raw `Value` encoding of this block argument.
234 fn decode_from_value(v: Value) -> Self {
235 let raw = v.as_u32();
236 let tag = raw >> 30;
237 let payload = raw & ((1 << 30) - 1);
238 match tag {
239 0 => BlockArg::Value(Value::from_bits(payload)),
240 1 => BlockArg::TryCallRet(payload),
241 2 => BlockArg::TryCallExn(payload),
242 _ => unreachable!(),
243 }
244 }
245
246 /// Return this argument as a `Value`, if it is one, or `None`
247 /// otherwise.

Callers

nothing calls this directly

Calls 2

ValueClass · 0.70
as_u32Method · 0.45

Tested by

no test coverage detected