Decode a raw `Value` encoding of this block argument.
(v: Value)
| 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. |