Improve handling of strings for backtraces (#843)
* Improve handling of strings for backtraces Largely avoid storing strings at all in the `wasmtime-*` internal crates, and instead only store strings in a separate global cache specific to the `wasmtime` crate itself. This global cache is inserted and removed from dynamically as modules are created and deallocated, and the global cache is consulted whenever a `Trap` is created to symbolicate any wasm frames. This also avoids the need to thread `module_name` through the jit crates and back, and additionally removes the need for `ModuleSyncString`. * Run rustfmt
This commit is contained in:
@@ -167,15 +167,9 @@ impl Compiler {
|
||||
self.jit_function_ranges
|
||||
.push((ptr as usize, ptr as usize + body_len));
|
||||
let func_index = module.func_index(i);
|
||||
let func_name = module
|
||||
.func_names
|
||||
.get(func_index)
|
||||
.cloned()
|
||||
.unwrap_or_else(Default::default);
|
||||
let tag = jit_function_registry::JITFunctionTag {
|
||||
module_id: module.name.clone(),
|
||||
func_index: func_index.index(),
|
||||
func_name,
|
||||
module_id: module.id,
|
||||
func_index,
|
||||
};
|
||||
jit_function_registry::register(ptr as usize, ptr as usize + body_len, tag);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user