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

Method import_transcoder

crates/environ/src/fact.rs:499–523  ·  view source on GitHub ↗
(&mut self, transcoder: transcode::Transcoder)

Source from the content-addressed store, hash-verified

497 }
498
499 fn import_transcoder(&mut self, transcoder: transcode::Transcoder) -> FuncIndex {
500 *self
501 .imported_transcoders
502 .entry(transcoder)
503 .or_insert_with(|| {
504 // Add the import to the core wasm import section...
505 let name = transcoder.name();
506 let ty = transcoder.ty(&mut self.core_types);
507 self.core_imports.import("transcode", &name, ty);
508
509 // ... and also record the metadata for what this import
510 // corresponds to.
511 let from = self.imported_memories[transcoder.from_memory].clone();
512 let to = self.imported_memories[transcoder.to_memory].clone();
513 self.imports.push(Import::Transcode {
514 op: transcoder.op,
515 from,
516 from64: transcoder.from_memory64,
517 to,
518 to64: transcoder.to_memory64,
519 });
520
521 self.imported_funcs.push(None)
522 })
523 }
524
525 fn import_simple(
526 &mut self,

Callers 1

transcoderMethod · 0.80

Calls 7

or_insert_withMethod · 0.80
entryMethod · 0.45
nameMethod · 0.45
tyMethod · 0.45
importMethod · 0.45
cloneMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected