-
Notifications
You must be signed in to change notification settings - Fork 4.9k
RuntimeHelpers.PrepareDelegate/PrepareMethod should JIT the given method #9437
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
Comments
PrepareConstrainedRegions is no-op in .NET Core. |
There is not such method today. I think it may be reasonable to fix RuntimeHelpers.PrepareDelegate / PrepareMethod to JIT the method given to it (just the single method - without the complicated limited call-graph walk done by full .NET Framework implementation). |
This could be very useful for hardware intrinsics in R2R scenarios. |
@4creators Could you please elaborate why you think it would be helpful? |
Yes, this would be nice, based on this comment from @AndyAyersMS it currently has some limitations and the workaround is tricky. Although I assume from your comment that you're not proposing to also JIT the entire call-graph, just a single method, is that correct? Would |
The problem is with finding the entire call-graph is. Static non-virtual calls are easy, but the transitive closure can be very large. In full .NET Framework, this method also consults ReliabilityContract attributes to constraint the call graph to reasonable size. Virtual calls, generics and every other runtime feature are hard. It would basically have to do same kind of global analysis as full AOT compilation does (slow and complex). We prefer to describe behavior in terms of what guarantees are provided. Not in terms of how the guarantees are implemented. The guarantees that the This feature was originally implemented for SQL CLR. It was super hard to test and use correctly.
This applies to .NET Framework. My though above was that we can improve .NET Core compatibility for cases where folks take advantage of PrepareMethod side-effects in .NET Framework. |
@jkotas I'm fine with this issue being closed or re-purposed to track support for |
CoreCLR implementation of this method triggers jiting of the given method only. It does not walk a subset of callgraph to provide CER guarantees because of CERs are not supported by CoreCLR. Fixes #15522
…16382) * Implement RuntimeHelpers.PrepareMethod/PrepareDelegate for CoreCLR CoreCLR implementation of this method triggers jiting of the given method only. It does not walk a subset of callgraph to provide CER guarantees because of CERs are not supported by CoreCLR. Fixes #15522
Thank you for implementing @jkotas! |
There is a comment here:
https://github.com/dotnet/coreclr/blob/b9affb49f79ed8319923c2f5b07b4aeeb04efe36/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs#L147-L149
But I can't figure out if it is supported or not.
In case it isn't supported, is there another way to ensure certain methods in a call graph are jitted? Or to jit a method without calling it?
The text was updated successfully, but these errors were encountered: