Resolves `GlobalData` of a global at the given index.
(&mut self, index: GlobalIndex)
| 212 | |
| 213 | /// Resolves `GlobalData` of a global at the given index. |
| 214 | pub fn resolve_global(&mut self, index: GlobalIndex) -> GlobalData { |
| 215 | let ty = self.translation.module.globals[index].wasm_ty; |
| 216 | let val = || match self.translation.module.defined_global_index(index) { |
| 217 | Some(defined_index) => GlobalData { |
| 218 | offset: self.vmoffsets.vmctx_vmglobal_definition(defined_index), |
| 219 | imported: false, |
| 220 | ty, |
| 221 | }, |
| 222 | None => GlobalData { |
| 223 | offset: self.vmoffsets.vmctx_vmglobal_import_from(index), |
| 224 | imported: true, |
| 225 | ty, |
| 226 | }, |
| 227 | }; |
| 228 | |
| 229 | *self.resolved_globals.entry(index).or_insert_with(val) |
| 230 | } |
| 231 | |
| 232 | /// Returns the table information for the given table index. |
| 233 | pub fn resolve_table_data(&mut self, index: TableIndex) -> TableData { |
no test coverage detected