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

Method entry

cranelift/codegen/src/ctxhash.rs:120–138  ·  view source on GitHub ↗

Look up a key, returning an `Entry` that refers to an existing value or allows inserting a new one.

(&'a mut self, k: K, ctx: &Ctx)

Source from the content-addressed store, hash-verified

118 /// Look up a key, returning an `Entry` that refers to an existing
119 /// value or allows inserting a new one.
120 pub fn entry<'a, Ctx>(&'a mut self, k: K, ctx: &Ctx) -> Entry<'a, K, V>
121 where
122 Ctx: CtxEq<K, K> + CtxHash<K>,
123 {
124 let hash = compute_hash(ctx, &k);
125 let raw = self.raw.entry(
126 hash as u64,
127 |bucket| hash == bucket.hash && ctx.ctx_eq(&bucket.k, &k),
128 |bucket| compute_hash(ctx, &bucket.k) as u64,
129 );
130 match raw {
131 hashbrown::hash_table::Entry::Occupied(o) => Entry::Occupied(OccupiedEntry { raw: o }),
132 hashbrown::hash_table::Entry::Vacant(v) => Entry::Vacant(VacantEntry {
133 hash,
134 key: k,
135 raw: v,
136 }),
137 }
138 }
139}
140
141/// A reference to an existing or vacant entry in the hash table.

Callers 15

armMethod · 0.45
arm_no_fieldsMethod · 0.45
dump_eh_frameFunction · 0.45
declare_functionMethod · 0.45
declare_functionMethod · 0.45
declare_dataMethod · 0.45
set_val_labelMethod · 0.45
build_variable_poolMethod · 0.45
mutateMethod · 0.45
lookup_symbolMethod · 0.45

Calls 2

compute_hashFunction · 0.85
ctx_eqMethod · 0.45

Tested by 1

dump_eh_frameFunction · 0.36