MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / resolve_global

Method resolve_global

winch/codegen/src/codegen/env.rs:214–230  ·  view source on GitHub ↗

Resolves `GlobalData` of a global at the given index.

(&mut self, index: GlobalIndex)

Source from the content-addressed store, hash-verified

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 {

Callers 1

emit_get_global_addrMethod · 0.80

Calls 5

defined_global_indexMethod · 0.80
or_insert_withMethod · 0.80
entryMethod · 0.45

Tested by

no test coverage detected