Make backtrace buffer handling more systematic (#33277)
Increase expressibility of what can be stored in backtrace buffers,
while ensuring that the GC can find roots without knowing about the
detail.
To do this, introduce a new "extended backtrace entry" format which
carries along the number of roots and other data in a bitpacked format.
This allows the backtrace buffer to be traversed and the roots collected
in a general way, without the GC knowing about interpreter frames. Use
this to add the module to InterperterIP so that the module of
interpreted top level thunks can be known.
In the future the extended entry format should allow us to be a lot more
flexible with what can be stored in a backtrace. For example, we could
* Compress the backtrace cycles of runaway recursive functions so that
stack overflows are much more likely to fit in the fixed-size bt_data
array.
* Integrate external or other types of interpreter frames into the
backtrace machinery.