Open kg opened 1 month ago
Notes about rejit and crossgen from David Mason on discord:
ReJIT is a concept in the ICorProfiler interface, and it's a little confusingly named versus tiered compilation. ReJIT is talking about the ability of an ICorProfiler (C++ library that can hook in to extension points in the runtime) to be able to arbitrarily rewrite the IL of a method. The intended case is for APM stuff like AppInsights, etc, to be able to inject instrumentation in methods to keep track of http calls, exceptions thrown, whatever In the desktop days the way we did ReJIT was incompatible with NGEN images so profilers had to block the whole image or at least the methods they cared about from loading (there are APIs for that too) and force them to jit normally so they could participate In the modern runtime and R2R images you can ReJIT methods that are already loaded via R2R Let me know if you want more details on any specific area PS if anyone from the jit team is talking about rejit they almost always mean tiered compilation
EDIT: The issue may be related to how some of the crossgen lanes have tiered compilation turned off.
In this test, InlineeTarget is not being inlined when it's expected to. The expected rejit count is -1 because it wasn't inlined.
CompositeBuildMode=1
causes this to pass (EDIT: Intermittently 🤷♀️), with a rejit count of 3. CompositeBuildMode=0
makes it fail.
The ReJIT profiler test does not pass on the crossgen outerloop lanes. It's not clear to me whether we should expect this to pass; I don't know much about ReJIT but it seems like it might not be conceptually compatible with what crossgen does. The profiler events seem to be working but something is going wrong with the test.