[mono][aot] Optimize stack unwind data for exception handling #82938
Labels
area-Codegen-AOT-mono
size-reduction
Issues impacting final app size primary for size sensitive workloads
Milestone
Description
The idea of this issue is to discover potential size improvements in Mono AOT compiler by optimizing unwind data in an AOT image.
Mono's backend emit generated unwind info into Mono specific format for Mono unwinder in addition to OS specific unwind data, as outlined in #82101 (comment). When using the AOT compiler, DWARF unwind info is generated in addition to OS specific unwind info, but on platform that doesn't use dwarf (i.e. Windows), the AOT image would end up with both Mono unwind info as well as OS specific unwind info per function.
Stack unwind handles the execution state of a thread during exception handling by using arch-specific structure that contains the values of all the CPU registers relevant during the exception handling. They are required by any procedure to be saved/restored before/after using them, and are usually defined by platform ABI. In case of generic sharing, inflated instances have different value types but share the same method body. When using the AOT compiler, the instances might share the same unwind data due to the same method body.
/cc: @lateralusX @vargaz @lambdageek
The text was updated successfully, but these errors were encountered: