improve performance

This commit is contained in:
2026-03-24 13:40:32 +00:00
parent 61cd7611bb
commit d511ae4fe9
4 changed files with 90 additions and 56 deletions
@@ -335,10 +335,11 @@ impl Linker {
// This preserves exact ends emitted by the compiler while still filling lengths for functions
// that lack enriched annotations.
let total_len = combined_code.len();
let layouts = layout::compute_function_layouts(&combined_functions, total_len);
for i in 0..combined_functions.len() {
if !has_precise_len.get(i).copied().unwrap_or(false) {
let start = combined_functions[i].code_offset as usize;
let end = layout::function_end_from_next(&combined_functions, i, total_len);
let start = layouts[i].start;
let end = layouts[i].end;
combined_functions[i].code_len = end.saturating_sub(start) as u32;
}
}