Loads the address of the given global.
(&mut self, index: GlobalIndex)
| 556 | |
| 557 | /// Loads the address of the given global. |
| 558 | pub fn emit_get_global_addr(&mut self, index: GlobalIndex) -> Result<(WasmValType, Reg, u32)> { |
| 559 | let data = self.env.resolve_global(index); |
| 560 | |
| 561 | if data.imported { |
| 562 | let global_base = self.masm.address_at_reg(vmctx!(M), data.offset)?; |
| 563 | let dst = self.context.any_gpr(self.masm)?; |
| 564 | self.masm.load_ptr(global_base, writable!(dst))?; |
| 565 | Ok((data.ty, dst, 0)) |
| 566 | } else { |
| 567 | Ok((data.ty, vmctx!(M), data.offset)) |
| 568 | } |
| 569 | } |
| 570 | |
| 571 | pub fn emit_table_get(&mut self, table_index: TableIndex) -> Result<()> { |
| 572 | let table = self.env.table(table_index); |
no test coverage detected