Skip to content

[mono] Do not collect uninflated generic methods for AOT compilation #71072

@ivanpovazan

Description

@ivanpovazan

With the change introduced at #70838 it can happen that uninflated generic methods are collected for AOTing. Compiling these methods fails and is skipped, which can be observed by passing --aot=print-skipped to the AOT compiler when compiling:

private static void Foo1<T>(T p) where T : struct
{
}

Output:

Skip (gshared failure): void HelloWorld.Program:Foo1<T> (T) ((null))

The root cause of this problem is that the AOT runtime assumes that the index of 'normal' methods is the same as their token as pointed out by @vargaz here, which means that solving this problem would require either:

  • to remove this assumption and not to collect uninflated generic methods, or
  • mark collected uninflated generic methods to be skipped when compiling

Even though this issue does not cause the AOT compiler to crash, nor it causes runtime failures, it is still an unwanted behaviour.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions