Fix issues with virtuals and mdarrays (#53400)
authorDavid Wrighton <davidwr@microsoft.com>
Mon, 31 May 2021 07:36:24 +0000 (00:36 -0700)
committerGitHub <noreply@github.com>
Mon, 31 May 2021 07:36:24 +0000 (09:36 +0200)
commitfea7ff2cce79da2df9cf1c50ce215287750f055e
tree5b233aa1de06132180c823ff3f29d7c240428cf0
parent8538a754f4fcbe190d9299d6f153db2cea39748e
Fix issues with virtuals and mdarrays (#53400)

- Change up the definition of an MDArray which doesn't need a special descriptor in the embedded signature data to match the type of mdarray thay everyone always uses. This fixes the virtual function handling behavior for all reasonable cases. (All cases where the MDArray is used for a base type in the expected fashion.)
- Add a devirtualization test for this specific scenario

Fixes #52444
src/coreclr/tools/Common/TypeSystem/Ecma/EcmaSignatureParser.cs
src/coreclr/tools/Common/TypeSystem/MetadataEmitter/TypeSystemMetadataEmitter.cs
src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/Signature.il
src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/SignatureTests.cs
src/tests/JIT/opt/Devirtualization/GenericArrayOverride.il [new file with mode: 0644]
src/tests/JIT/opt/Devirtualization/GenericArrayOverride.ilproj [new file with mode: 0644]