mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
Wasm: sort and deduplicate on each round of live function tracing
This commit is contained in:
parent
9dabc2db15
commit
6b204d11a2
2 changed files with 5 additions and 1 deletions
|
@ -96,7 +96,8 @@ pub fn build_module_help<'a>(
|
|||
let initial_module = WasmModule::preload(env.arena, preload_bytes);
|
||||
|
||||
// Adjust Wasm function indices to account for functions from the object file
|
||||
let fn_index_offset: u32 = initial_module.import.function_count + initial_module.code.preloaded_count;
|
||||
let fn_index_offset: u32 =
|
||||
initial_module.import.function_count + initial_module.code.preloaded_count;
|
||||
|
||||
// Get a map of name to index for the preloaded functions
|
||||
// Assumes the preloaded object file has all symbols exported, as per `zig build-lib -dymamic`
|
||||
|
|
|
@ -140,6 +140,9 @@ pub fn trace_function_deps<'a, Indices: IntoIterator<Item = u32>>(
|
|||
if next_trace.is_empty() {
|
||||
break;
|
||||
}
|
||||
next_trace.sort_unstable();
|
||||
next_trace.dedup();
|
||||
|
||||
current_trace.clone_from(&next_trace);
|
||||
next_trace.clear();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue