[mono][aot] Avoid generating rgctx fetch trampolines in generic sharing #82906
Labels
area-Codegen-AOT-mono
size-reduction
Issues impacting final app size primary for size sensitive workloads
Milestone
Description
For a generic sharing methods, size of variable types is only known at runtime and AOT compiler cannot allocate static stack slots for them. Instead, a stack area is allocated at runtime and address is dynamically computed. The information required for this is either stored in the vtable or in a
MonoMethodRuntimeGenericContext
structure. In the structure, the offsets are known at compile time so it can generate inline code. However, in the vtable, they are assigned at runtime, so rgctx fetch trampolines are used to read it.In order to improve size of an AOT image, the idea is to pass the structure to all gshared methods, and thus avoid generating rgctx fetch trampolines. As it requires a lot of changes, an experimental data on size and speed should be retrieved before considering the implementation.
The text was updated successfully, but these errors were encountered: