Skip to content

[mono][aot] Avoid generating rgctx fetch trampolines in generic sharing #82906

Closed
@kotlarmilos

Description

@kotlarmilos

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.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions