-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[DWARF] Synthetic type centralization #9700
Conversation
unit_id | ||
} | ||
|
||
fn create_vmctx_ptr_die( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Below code was simply moved from utils.rs
without functional changes.
let mut module_wasm_types = PrimaryMap::new(); | ||
for (module, memory_offset) in compilation.module_memory_offsets.iter() { | ||
let wasm_types = add_wasm_types(unit, root_id, out_strings, memory_offset); | ||
let i = module_wasm_types.push(wasm_types); | ||
assert_eq!(i, module); | ||
} | ||
|
||
let wasm_types = add_wasm_types(unit, root_id, out_strings); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since all of the remaining wasm_types
are module-invariant, there is no longer a need for them to be per-module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
The DWARF transform needs to add some "synthetic" types to the output, mainly to represent the VMContext structure.
So far, these types were being added to each CU, which is unnecessary overhead since they're exactly the same in each CU in a given module.
This change moves them to a single per-module CU that is references via DWARF's
DW_FORM_ref_addr
mechanism.This is an optimization in both time (the debugger needs fewer types to keep track of) and space (the
.debug_info
section is ~5% smaller on some DWARF input I have).