Get a little endian representation of the immediate. This method heap allocates and is intended to be used when adding values to the constant pool.
(&self)
| 1218 | /// This method heap allocates and is intended to be used when adding |
| 1219 | /// values to the constant pool. |
| 1220 | pub fn to_bytes(&self) -> Vec<u8> { |
| 1221 | match self { |
| 1222 | Imm::I32(n) => n.to_le_bytes().to_vec(), |
| 1223 | Imm::I64(n) => n.to_le_bytes().to_vec(), |
| 1224 | Imm::F32(n) => n.to_le_bytes().to_vec(), |
| 1225 | Imm::F64(n) => n.to_le_bytes().to_vec(), |
| 1226 | Imm::V128(n) => n.to_le_bytes().to_vec(), |
| 1227 | } |
| 1228 | } |
| 1229 | } |
| 1230 | |
| 1231 | /// The location of the [VMcontext] used for function calls. |