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

Method intern_name

winch/codegen/src/codegen/env.rs:383–388  ·  view source on GitHub ↗

Interns `name` into a `UserExternalNameRef` and ensures that duplicate instances of `name` are given a unique name ref index.

(&mut self, name: UserExternalName)

Source from the content-addressed store, hash-verified

381 /// Interns `name` into a `UserExternalNameRef` and ensures that duplicate
382 /// instances of `name` are given a unique name ref index.
383 fn intern_name(&mut self, name: UserExternalName) -> UserExternalNameRef {
384 *self
385 .name_intern
386 .entry(name.clone())
387 .or_insert_with(|| self.name_map.push(name))
388 }
389
390 /// Extracts the name map that was created while translating this function.
391 pub fn take_name_map(&mut self) -> PrimaryMap<UserExternalNameRef, UserExternalName> {

Callers 2

name_builtinMethod · 0.80
name_wasmMethod · 0.80

Calls 4

or_insert_withMethod · 0.80
entryMethod · 0.45
cloneMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected