Disclaimer: I am not an expert in CLR or RyuJIT. Perhaps I am completely mistaken in all of this.
I met the following in the chapter of the RyuJIT Runtime Book:
For lvlVars with tracked lifetimes or for an expression containing GC links, we report the range in which the link is in real time. This is done by the emitter, which adds this information to the instruction group and which completes the instruction group when the GC information changes.
The structure that appears to store this information is in jit / jitgcinfo.h and looks like this:
struct varPtrDsc { varPtrDsc * vpdNext; unsigned vpdVarNum;
In the paragraph above, it is clear that these fields are filled in by the "emitter", and I believe that they mean jit / emit.cpp .
The start of the lifetime is set in emitter::emitGCvarLiveSet() ; appropriate exposure (spaces removed for brevity):
desc = new (emitComp, CMK_GC) varPtrDsc; desc->vpdBegOfs = emitCurCodeOffs(addr); #ifdef DEBUG desc->vpdEndOfs = 0xFACEDEAD; #endif desc->vpdVarNum = offs; desc->vpdNext = NULL;
The end of the lifetime is set in the same way in emitter::emitGCvarDeadSet() :
assert(desc->vpdEndOfs == 0xFACEDEAD); desc->vpdEndOfs = emitCurCodeOffs(addr);
Finally, the tables are apparently written in jit / gcencode.cpp , in particular in GCInfo::gcMakeVarPtrTable() .
Hope this serves as a starting point if you want to continue exploring.
source share