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

Method encode_as_value

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

Encode this block argument as a `Value` for storage in the value pool. Internal to `BlockCall`, must not be used elsewhere to avoid exposing the raw bit encoding.

(&self)

Source from the content-addressed store, hash-verified

220 /// value pool. Internal to `BlockCall`, must not be used
221 /// elsewhere to avoid exposing the raw bit encoding.
222 fn encode_as_value(&self) -> Value {
223 let (tag, payload) = match *self {
224 BlockArg::Value(v) => (0, v.as_bits()),
225 BlockArg::TryCallRet(i) => (1, i),
226 BlockArg::TryCallExn(i) => (2, i),
227 };
228 assert!(payload < (1 << 30));
229 let raw = (tag << 30) | payload;
230 Value::from_bits(raw)
231 }
232
233 /// Decode a raw `Value` encoding of this block argument.
234 fn decode_from_value(v: Value) -> Self {

Callers 4

newMethod · 0.80
append_argumentMethod · 0.80
update_argsMethod · 0.80
extendMethod · 0.80

Calls 1

as_bitsMethod · 0.80

Tested by

no test coverage detected