From dc8058b5160797879962e61ac594f78003bfb53d Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 26 Nov 2025 17:23:53 -0800 Subject: [PATCH] Create MethodGenericDictionary for calls to GVMs --- .../tools/aot/ILCompiler.Compiler/IL/ILImporter.Scanner.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/IL/ILImporter.Scanner.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/IL/ILImporter.Scanner.cs index 8bb7c1f6eedd6c..c5fa24eb2b096b 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/IL/ILImporter.Scanner.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/IL/ILImporter.Scanner.cs @@ -746,6 +746,13 @@ private void ImportCall(ILOpcode opcode, int token) else { _dependencies.Add(_factory.RuntimeMethodHandle(methodToLookup), reason); + + MethodDesc concreteMethod = targetMethod; + targetMethod = targetMethod.GetCanonMethodTarget(CanonicalFormKind.Specific); + if (targetMethod.RequiresInstMethodDescArg()) + { + _dependencies.Add(_factory.MethodGenericDictionary(concreteMethod), reason); + } } _dependencies.Add(GetHelperEntrypoint(ReadyToRunHelper.GVMLookupForSlot), reason);