Files
wasmtime/cranelift/codegen
Chris Fallin d9d6469422 Cranelift: fix debuginfo wrt cold blocks and non-monotonic layout.
The debuginfo analyses are written with the assumption that the order of
instructions in the VCode is the order of instructions in the final
machine ocde. This was previously a strong invariant, until we
introduced support for cold blocks. Cold blocks are implemented by
reordering during emission, because the VCode ordering has other
requirements related to lowering (respecting def-use dependencies in the
reverse pass), so it is much simpler to reorder instructions at the last
moment. Unfortunately, this causes the breakage we now see.

This commit fixes the issue by skipping all cold instructions when
emitting value-label ranges (which are translated into debuginfo). This
means that variables defined in cold blocks will not have DWARF
metadata. But cold blocks are usually compiler-inserted slowpaths, not
user code, so this is probably OK. Debuginfo is always best-effort, so
in any case this does not violate any correctness constraints.
2022-02-04 23:15:04 -08:00
..
2021-10-10 14:19:08 +02:00
2022-01-05 13:26:50 -06:00

This crate contains the core Cranelift code generator. It translates code from an intermediate representation into executable machine code.