Skip to content
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

[mono][aot] Optimize stack unwind data for exception handling #82938

Closed
Tracked by #80938
kotlarmilos opened this issue Mar 3, 2023 · 2 comments
Closed
Tracked by #80938

[mono][aot] Optimize stack unwind data for exception handling #82938

kotlarmilos opened this issue Mar 3, 2023 · 2 comments
Assignees
Labels
area-Codegen-AOT-mono size-reduction Issues impacting final app size primary for size sensitive workloads
Milestone

Comments

@kotlarmilos
Copy link
Member

kotlarmilos commented Mar 3, 2023

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

@kotlarmilos kotlarmilos added area-Codegen-AOT-mono size-reduction Issues impacting final app size primary for size sensitive workloads labels Mar 3, 2023
@kotlarmilos kotlarmilos added this to the Future milestone Mar 3, 2023
@kotlarmilos kotlarmilos self-assigned this Mar 3, 2023
@ghost
Copy link

ghost commented Mar 3, 2023

Tagging subscribers to 'size-reduction': @eerhardt, @SamMonoRT, @marek-safar
See info in area-owners.md if you want to be subscribed.

Issue Details

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

Author: kotlarmilos
Assignees: kotlarmilos
Labels:

area-Codegen-AOT-mono, size-reduction

Milestone: Future

@kotlarmilos kotlarmilos modified the milestones: Future, 9.0.0 Jul 13, 2023
@kotlarmilos kotlarmilos modified the milestones: 9.0.0, Future Feb 9, 2024
@kotlarmilos
Copy link
Member Author

Obsolete, lower priority compared to other tasks.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 30, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
area-Codegen-AOT-mono size-reduction Issues impacting final app size primary for size sensitive workloads
Projects
None yet
Development

No branches or pull requests

1 participant