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

Method get

cranelift/interpreter/src/frame.rs:35–60  ·  view source on GitHub ↗
(&self, name: ValueRef)

Source from the content-addressed store, hash-verified

33 /// Retrieve the actual value associated with an SSA reference.
34 #[inline]
35 pub fn get(&self, name: ValueRef) -> &DataValue {
36 assert!(name.index() < self.registers.len());
37 trace!("Get {name}");
38 &self
39 .registers
40 .get(name.index())
41 .unwrap_or_else(|| panic!("unknown value: {name}"))
42 .as_ref()
43 .or_else(|| {
44 // We couldn't find the `name` value directly in `registers`, but it is still
45 // possible that it is aliased to another value.
46
47 // If we are looking up an undefined value it will have an invalid type, return
48 // before trying to resolve it.
49 if self.function.dfg.value_type(name) == types::INVALID {
50 return None;
51 }
52
53 let alias = self.function.dfg.resolve_aliases(name);
54 self.registers
55 .get(alias.index())
56 .unwrap_or_else(|| panic!("unknown value: {alias}"))
57 .as_ref()
58 })
59 .unwrap_or_else(|| panic!("empty slot: {name}"))
60 }
61
62 /// Retrieve multiple SSA references; see `get`.
63 pub fn get_all(&self, names: &[ValueRef]) -> Vec<DataValue> {

Callers 12

collect_block_argsFunction · 0.45
stepFunction · 0.45
collect_valuesMethod · 0.45
index_ofMethod · 0.45
get_by_indexMethod · 0.45
get_function_nameFunction · 0.45
resolve_global_valueMethod · 0.45
get_allMethod · 0.45
renameFunction · 0.45

Calls 4

resolve_aliasesMethod · 0.80
as_refMethod · 0.45
indexMethod · 0.45
value_typeMethod · 0.45

Tested by

no test coverage detected