Yichun Zhang (agentzh) wrote: > This is essentially the debug information for the machine code > generated by the JIT compiler The IR already has that info. All snapshots of a trace carry a bytecode PC plus the (partial) frame info relative to the base frame of the trace. From that info you can pretty accurately reconstruct the control flow of the whole trace ('connect the dots'). (*) You could expose that info via jit.util.tracesnap(). Look at lj_snap_restore() on how to get at the PC and the frame links. (*) There's an optimization which directs an exit to the other side of a conditional (instead of retrying it). But this is always followed by another snapshot that continues the control flow. The individual basic blocks of the machine code can be mapped back to the IR with a similar algorithm, by tracking the trace exit stubs and mapping them back to the snapshots in the IR. The jit.dump() module has the code to detect the branches to the trace exit stubs and insert the exit numbers into the disassebly. --Mike