Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
RuntimeHelpers.PrepareDelegate/PrepareMethod should JIT the given method #15522
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).
referenced this issue
Dec 14, 2017
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?
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.