Refactor where results of compilation are stored (#2086)
* Refactor where results of compilation are stored This commit refactors the internals of compilation in Wasmtime to change where results of individual function compilation are stored. Previously compilation resulted in many maps being returned, and compilation results generally held all these maps together. This commit instead switches this to have all metadata stored in a `CompiledFunction` instead of having a separate map for each item that can be stored. The motivation for this is primarily to help out with future module-linking-related PRs. What exactly "module level" is depends on how we interpret modules and how many modules are in play, so it's a bit easier for operations in wasmtime to work at the function level where possible. This means that we don't have to pass around multiple different maps and a function index, but instead just one map or just one entry representing a compiled function. Additionally this change updates where the parallelism of compilation happens, pushing it into `wasmtime-jit` instead of `wasmtime-environ`. This is another goal where `wasmtime-jit` will have more knowledge about module-level pieces with module linking in play. User-facing-wise this should be the same in terms of parallel compilation, though. The ultimate goal of this refactoring is to make it easier for the results of compilation to actually be a set of wasm modules. This means we won't be able to have a map-per-metadata where the primary key is the function index, because there will be many modules within one "object file". * Don't clear out fields, just don't store them Persist a smaller set of fields in `CompilationArtifacts` instead of trying to clear fields out and dynamically not accessing them.
This commit is contained in:
@@ -22,6 +22,7 @@ wasmtime-runtime = { path = "../runtime", version = "0.19.0" }
|
||||
wasmtime-debug = { path = "../debug", version = "0.19.0" }
|
||||
wasmtime-profiling = { path = "../profiling", version = "0.19.0" }
|
||||
wasmtime-obj = { path = "../obj", version = "0.19.0" }
|
||||
rayon = { version = "1.0", optional = true }
|
||||
region = "2.1.0"
|
||||
thiserror = "1.0.4"
|
||||
target-lexicon = { version = "0.10.0", default-features = false }
|
||||
@@ -41,6 +42,7 @@ winapi = { version = "0.3.8", features = ["winnt", "impl-default"] }
|
||||
lightbeam = ["wasmtime-environ/lightbeam"]
|
||||
jitdump = ["wasmtime-profiling/jitdump"]
|
||||
vtune = ["wasmtime-profiling/vtune"]
|
||||
parallel-compilation = ["rayon"]
|
||||
|
||||
# Try the experimental, work-in-progress new x86_64 backend. This is not stable
|
||||
# as of June 2020.
|
||||
|
||||
Reference in New Issue
Block a user