Make virtual delegate targets less costly (#87308)
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>
Fri, 16 Jun 2023 00:55:40 +0000 (09:55 +0900)
committerGitHub <noreply@github.com>
Fri, 16 Jun 2023 00:55:40 +0000 (09:55 +0900)
commit35a5afb63fb08edca5d04a382d0663c2e1031e7a
treee25bc7e6bdaea66ac6b7cb676edf8190a62a8510
parent9fc19a1f9b00ad9631a81fbe4b7b2141f9209e32
Make virtual delegate targets less costly (#87308)

Saves 1.5% on the Stage2 app.

We make sure delegate targets are reflection visible to support Delegate.GetMethodInfo. When I originally did this work in #70198 I made a shortcut to avoid yet another node kind in the system (with a giant comment explaining what the problem is). But there's a lot of benefit in having this new node for apps with many reflection visible virtual methods.
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/DelegateTargetVirtualMethodNode.cs [new file with mode: 0644]
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/NodeFactory.cs
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/UsageBasedMetadataManager.cs
src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj
src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/StaticInterfaceMethodDataflow.cs