Uh oh!
There was an error while loading. Please reload this page.
Make casting helpers look more like in CoreCLR - #86029
Conversation
Speeds up casting to interfaces by about 50%. Speeds up casting to classes by about 20%. There are small differences compared to CoreCLR: * NativeAOT runtime considers interfaces implementable by arrays to be variant. We don't need to special case casting arrays to non-variant (in IL sense) interfaces because those naturally take the variant paths. * The base type field on arrays holds the array element type so we need to check for the array case before starting to chase the base hierarchy. Otherwise the top level helpers now look mostly the same as the CoreCLR ones.
ghost
commented
May 10, 2023
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue DetailsSpeeds up casting to interfaces by about 50%. Speeds up casting to classes by about 20%. There are small differences compared to CoreCLR:
Otherwise the top level helpers now look mostly the same as the CoreCLR ones. Cc @dotnet/ilc-contrib
|
MichalStrehovsky
commented
May 10, 2023
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| return null; | ||
| } | ||
| [RuntimeExport("RhTypeCast_CheckCastClassSpecial")] | ||
| private static unsafe object CheckCastClassSpecial(MethodTable* pTargetType, object obj) |
There was a problem hiding this comment.
It would be nice to unify the names with CoreCLR impl (Check vs. Chk) so that the implementations are easy to match (and eventually share). It can be separate rename-only PR.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
VSadov
commented
May 10, 2023
I think this PR will resolve #84464 |
Speeds up casting to interfaces by about 50%. Speeds up casting to classes by about 20%.
There are small differences compared to CoreCLR:
Otherwise the top level helpers now look mostly the same as the CoreCLR ones.
Cc @dotnet/ilc-contrib