ReJIT for Realz?!

Yes!  Check out this new video on channel 9 for the scoop:

In the upcoming .NET 4.5, we do indeed plan to include a limited form of ReJIT that will allow diagnostic tools to perform IL Rewriting after the code has been JITted—by instructing the CLR, via the Profiling API, to JIT the (now instrumented) method again (i.e., ReJIT it! ).

If you want to play with this feature, it is available in the .NET 4.5 Developer Preview.  You can search for it on the Microsoft Download Center, and you’ll find the .NET 4.5-only link and the full Visual Studio 11 link:

It will be tough to try it out now, though, as we don’t have docs or samples yet.  And note that there are several limitations, some of which are touched on in the video.  You’ll need to look through corprof.idl and turn on your mind-reading skills to figure it out.  But I will have a lot more to say about the feature and how you can use it in upcoming posts right here.