Struct wasmtime_environ::ModuleTranslation
source · [−]pub struct ModuleTranslation<'data> {
pub module: Module,
pub function_body_inputs: PrimaryMap<DefinedFuncIndex, FunctionBodyData<'data>>,
pub escaped_funcs: HashSet<DefinedFuncIndex>,
pub exported_signatures: Vec<SignatureIndex>,
pub debuginfo: DebugInfoData<'data>,
pub has_unparsed_debuginfo: bool,
pub data: Vec<Cow<'data, [u8]>>,
pub passive_data: Vec<&'data [u8]>,
/* private fields */
}
Expand description
The result of translating via ModuleEnvironment
. Function bodies are not
yet translated, and data initializers have not yet been copied out of the
original buffer.
Fields
module: Module
Module information.
function_body_inputs: PrimaryMap<DefinedFuncIndex, FunctionBodyData<'data>>
References to the function bodies.
escaped_funcs: HashSet<DefinedFuncIndex>
The set of defined functions within this module which are “possibly exported” which means that the host can possibly call them. This includes functions such as:
- Exported functions
- Functions in element segments
- Functions via
ref.func
instructions
This set is used to determine the set of type signatures that need trampolines for the host to call into.
exported_signatures: Vec<SignatureIndex>
A list of type signatures which are considered exported from this module, or those that can possibly be called. This list is sorted, and trampolines for each of these signatures are required.
debuginfo: DebugInfoData<'data>
DWARF debug information, if enabled, parsed from the module.
has_unparsed_debuginfo: bool
Set if debuginfo was found but it was not parsed due to Tunables
configuration.
data: Vec<Cow<'data, [u8]>>
List of data segments found in this module which should be concatenated together for the final compiled artifact.
These data segments, when concatenated, are indexed by the
MemoryInitializer
type.
passive_data: Vec<&'data [u8]>
List of passive element segments found in this module which will get concatenated for the final artifact.
Implementations
sourceimpl ModuleTranslation<'_>
impl ModuleTranslation<'_>
sourcepub fn try_paged_init(&mut self)
pub fn try_paged_init(&mut self)
Attempts to convert segmented memory initialization into paged initialization for the module that this translation represents.
If this module’s memory initialization is not compatible with paged
initialization then this won’t change anything. Otherwise if it is
compatible then the memory_initialization
field will be updated.
Trait Implementations
sourceimpl<'data> Default for ModuleTranslation<'data>
impl<'data> Default for ModuleTranslation<'data>
sourcefn default() -> ModuleTranslation<'data>
fn default() -> ModuleTranslation<'data>
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl<'data> RefUnwindSafe for ModuleTranslation<'data>
impl<'data> Send for ModuleTranslation<'data>
impl<'data> Sync for ModuleTranslation<'data>
impl<'data> Unpin for ModuleTranslation<'data>
impl<'data> UnwindSafe for ModuleTranslation<'data>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more