Module cranelift_codegen::machinst::debug[][src]

Debug info analysis: computes value-label ranges from value-label markers in generated VCode.

We “reverse-engineer” debug info like this because it is far more reliable than generating it while emitting code and keeping it in sync.

This works by (i) observing “value-label marker” instructions, which are semantically just an assignment from a register to a “value label” (which one can think of as another register; they represent, e.g., Wasm locals) at a certain point in the code, and (ii) observing loads and stores to the stack and register moves.

We track, at every program point, the correspondence between each value label and all locations in which it resides. E.g., if it is stored to the stack, we remember that it is in both a register and the stack slot; but if the register is later overwritten, then we have it just in the stack slot. This allows us to avoid false-positives observing loads/stores that we think are spillslots but really aren’t.

We do a standard forward dataflow analysis to compute this info.