Move wasm data/debuginfo into the ELF compilation image (#3235)
* Move wasm data/debuginfo into the ELF compilation image This commit moves existing allocations of `Box<[u8]>` stored separately from compilation's final ELF image into the ELF image itself. The goal of this commit is to reduce the amount of data which `bincode` will need to process in the future. DWARF debugging information and wasm data segments can be quite large, and they're relatively rarely read, so there's typically no need to copy them around. Instead by moving them into the ELF image this opens up the opportunity in the future to eliminate copies and use data directly as-found in the image itself. For information accessed possibly-multiple times, such as the wasm data ranges, the indexes of the data within the ELF image are computed when a `CompiledModule` is created. These indexes are then used to directly index into the image without having to root around in the ELF file each time they're accessed. One other change located here is that the symbolication context previously cloned the debug information into it to adhere to the `'static` lifetime safely, but this isn't actually ever used in `wasmtime` right now so the unsafety around this has been removed and instead borrowed data is returned (no more clones, yay!). * Fix lightbeam
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -3713,6 +3713,7 @@ dependencies = [
|
||||
"indexmap",
|
||||
"log",
|
||||
"more-asserts",
|
||||
"object",
|
||||
"serde",
|
||||
"target-lexicon",
|
||||
"thiserror",
|
||||
@@ -3798,6 +3799,7 @@ dependencies = [
|
||||
"cranelift-codegen",
|
||||
"gimli",
|
||||
"lightbeam",
|
||||
"object",
|
||||
"target-lexicon",
|
||||
"wasmparser",
|
||||
"wasmtime-environ",
|
||||
|
||||
Reference in New Issue
Block a user