Fix failure to generate ngen pdb in crossgen (#89415)
authorDavid Wrighton <davidwr@microsoft.com>
Tue, 25 Jul 2023 21:30:50 +0000 (14:30 -0700)
committerGitHub <noreply@github.com>
Tue, 25 Jul 2023 21:30:50 +0000 (14:30 -0700)
commit8c51f019880e620fc59299024518fb8d002033b3
tree18931b8b1b7cab2d79ff71786c118aaf176e8f47
parent0be3889fd32ecc43c3111bddecd765b6da1ad993
Fix failure to generate ngen pdb in crossgen (#89415)

* Fix issue in R2R compilation where we would compile a method we could not generate a name for
- This is caused by the the type of a parameter having a generic parameter which derived from a type not found in the compilation information
- There are 2 fixes here
  1. Change the logic for computing the set of compilable methods to require that all parameters are loadable
  2. Change the implementation of loadable types to check generic instantiations for loadability
    - This required implementing a stack system to check types for loadability, as loading can require circular references to be resolved.
    - Add a check that the instantiation types of an instantiated generic are loadable.
    - Generic interfaces on arrays work now, so enable the the constraint checking logic.
src/coreclr/tools/Common/Compiler/CompilerTypeSystemContext.Validation.cs
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunLibraryRootProvider.cs
src/tests/readytorun/regressions/GitHub_89337/GitHub_89337.cs [new file with mode: 0644]
src/tests/readytorun/regressions/GitHub_89337/GitHub_89337.il [new file with mode: 0644]
src/tests/readytorun/regressions/GitHub_89337/GitHub_89337.ilproj [new file with mode: 0644]