-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shuffle some items around in
wasmtime
(#7839)
* Shuffle some items around in `wasmtime` This is a follow-up to #7766 with some more changes and reorganization. These are some small items here and there which shouldn't have any actual impact on functionality but are intended to reorganize a bit. Changes here include: * Move component artifact definitions to `wasmtime-environ` as core module ones already live there. * Rename the module with module artifacts from `instantiate` to `module_artifacts`. * Make `wasmtime-jit-icache-coherence` an optional dependency as only the `runtime` feature requires it. * Reorganize serialized metadata for wasmtime ELF files to consolidate everything back into `wasmtime::engine::serialization`. This is to prevent the definition of the serialization format being spread across a few files. * Touching up the `serialization` module to compile in all builds of the `wasmtime` crate. * fix docs typo --------- Co-authored-by: Nick Fitzgerald <fitzgen@gmail.com>
- Loading branch information
1 parent
b5057d8
commit f0c9e9b
Showing
13 changed files
with
736 additions
and
757 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
//! Definitions of compilation artifacts of the component compilation process | ||
//! which are serialized with `bincode` into output ELF files. | ||
|
||
use crate::{ | ||
component::{AllCallFunc, Component, ComponentTypes, TrampolineIndex, TypeComponentIndex}, | ||
CompiledModuleInfo, FunctionLoc, PrimaryMap, StaticModuleIndex, | ||
}; | ||
use serde_derive::{Deserialize, Serialize}; | ||
|
||
/// Serializable state that's stored in a compilation artifact. | ||
#[derive(Serialize, Deserialize)] | ||
pub struct ComponentArtifacts { | ||
/// The type of this component. | ||
pub ty: TypeComponentIndex, | ||
/// Information all kept available at runtime as-is. | ||
pub info: CompiledComponentInfo, | ||
/// Type information for this component and all contained modules. | ||
pub types: ComponentTypes, | ||
/// Serialized metadata about all included core wasm modules. | ||
pub static_modules: PrimaryMap<StaticModuleIndex, CompiledModuleInfo>, | ||
} | ||
|
||
/// Runtime state that a component retains to support its operation. | ||
#[derive(Serialize, Deserialize)] | ||
pub struct CompiledComponentInfo { | ||
/// Type information calculated during translation about this component. | ||
pub component: Component, | ||
|
||
/// Where lowered function trampolines are located within the `text` | ||
/// section of `code_memory`. | ||
/// | ||
/// These are the | ||
/// | ||
/// 1. Wasm-call, | ||
/// 2. array-call, and | ||
/// 3. native-call | ||
/// | ||
/// function pointers that end up in a `VMFuncRef` for each | ||
/// lowering. | ||
pub trampolines: PrimaryMap<TrampolineIndex, AllCallFunc<FunctionLoc>>, | ||
|
||
/// The location of the wasm-to-native trampoline for the `resource.drop` | ||
/// intrinsic. | ||
pub resource_drop_wasm_to_native_trampoline: Option<FunctionLoc>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 2 additions & 4 deletions
6
crates/environ/src/instantiate.rs → crates/environ/src/module_artifacts.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.