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

Class Compilation

crates/cranelift/src/debug.rs:48–78  ·  view source on GitHub ↗

"Package structure" to collect together various artifacts/results of a compilation. This structure is threaded through a number of top-level functions of DWARF processing within in this submodule to pass along all the bits-and-pieces of the compilation context.

Source from the content-addressed store, hash-verified

46/// processing within in this submodule to pass along all the bits-and-pieces of
47/// the compilation context.
48pub struct Compilation<'a> {
49 /// All module translations which were present in this compilation.
50 ///
51 /// This map has one entry for core wasm modules and may have multiple (or
52 /// zero) for components.
53 translations: &'a PrimaryMap<StaticModuleIndex, ModuleTranslation<'a>>,
54
55 /// Accessor of a particular compiled function for a module.
56 ///
57 /// This returns the `object`-based-symbol for the function as well as the
58 /// `&CompiledFunction`.
59 get_func:
60 &'a dyn Fn(StaticModuleIndex, DefinedFuncIndex) -> (SymbolId, &'a CompiledFunctionMetadata),
61
62 /// Optionally-specified `*.dwp` file, currently only supported for core
63 /// wasm modules.
64 dwarf_package_bytes: Option<&'a [u8]>,
65
66 /// Compilation settings used when producing functions.
67 tunables: &'a Tunables,
68
69 /// Translation between `SymbolId` and a `usize`-based symbol which gimli
70 /// uses.
71 symbol_index_to_id: Vec<SymbolId>,
72 symbol_id_to_index: HashMap<SymbolId, (usize, StaticModuleIndex, DefinedFuncIndex)>,
73
74 /// The `ModuleMemoryOffset` for each module within `translations`.
75 ///
76 /// Note that this doesn't support multi-memory at this time.
77 module_memory_offsets: PrimaryMap<StaticModuleIndex, ModuleMemoryOffset>,
78}
79
80impl<'a> Compilation<'a> {
81 pub fn new(

Callers 2

fromMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected