-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cached interface dispatch for coreclr #111771
Cached interface dispatch for coreclr #111771
Conversation
… on shared things, and parts that are not shared
…an be switched between
… not yet supported
…ce dispatch or virtual stub dispatch
Tagging subscribers to this area: @mangod9 |
…te that this requires adding the -mcx16 switch to clang, so that cmpxchg16b instruction gets generated, which is an increase in the baseline CPU required by CoreCLR on Linux, and isn't likely to be OK for shipping publicly
…veAOT cached interface dispatch implementation (as it isn't actually used) Update IsIPinVirtualStub to check the AVLocations, not the stub entry points
…e_dispatch_for_coreclr
…hook up the VTable offset logic and such (vtable paths are untested)
- Enable generating double pointer indirection cells in R2R files using command line switch. - Fix VTableOffset calculation - Add logic in ExternalMethodFixupWorker to handle the double pointer indirection cells.
} | ||
|
||
MethodDesc *pTargetMD = COMDelegate::GetMethodDescForOpenVirtualDelegate(delegateObj); | ||
pSDFrame->SetFunction(pTargetMD); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If pSDFrame
is &frame
why are we indirecting through the pointer instead of using frame
directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is due to historical reasons. Until recently (3 weeks ago), the frame was FrameWithCookie<StubDispatchFrame>
and not just StubDispatchFrame
. So the StubDispatchFrame * pSDFrame = &frame
was used so that on every access we don't need to do casting. It isn't needed anymore.
src/tests/Loader/CollectibleAssemblies/Statics/CollectibleTLSStaticCollection.cs
Show resolved
Hide resolved
@davidwrighton is it supposed to exclude riscv64 and loongarch64? Test build has started to break:
|
I think I have a fix in #113179 |
Enabling cached interface dispatch as an options for CoreCLR (should reduce memory usage/remove RWX pages, at the cost of reducing performance)
DOTNET_UseCachedInterfaceDispatch
environment variable to 1. (NOTE: Enabling this feature requires running on a processor which supports 128 bit compare and swap, which has implications on Linux X64 builds, and would have implications for Loongarch/RiscV if we enable the code there.)VirtualCallStubManager
infrastructure for all non-code-generation driven lookups, but to replace the stub generation logic with the CachedInterfaceDispatch paths from NativeAOT.Known issues addressed before making a non-draft PR
Consider enabling the resolve cache for cached interface dispatch scenarios (will not do until perf results show that the current scheme is slow)PalInterlockedCompareExchange128
to the PAL or minipal