Returns the reference type to use for the provided wasm type.
(wasm_ht: WasmHeapType, pointer_type: ir::Type)
| 211 | |
| 212 | /// Returns the reference type to use for the provided wasm type. |
| 213 | fn reference_type(wasm_ht: WasmHeapType, pointer_type: ir::Type) -> ir::Type { |
| 214 | match wasm_ht.top() { |
| 215 | WasmHeapTopType::Func => pointer_type, |
| 216 | WasmHeapTopType::Any | WasmHeapTopType::Extern | WasmHeapTopType::Exn => ir::types::I32, |
| 217 | WasmHeapTopType::Cont => { |
| 218 | // VMContObj is 2 * pointer_size (pointer + usize revision) |
| 219 | ir::Type::int((2 * pointer_type.bits()).try_into().unwrap()).unwrap() |
| 220 | } |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | // List of namespaces which are processed in `mach_reloc_to_reloc` below. |
| 225 |
no test coverage detected