debug-info: Use a packed debug fun representation.
commit00fca651261274a8472f584610d7c12c13424bbe
authorCharles Zhang <charleszhang99@yahoo.com>
Thu, 11 Apr 2024 12:53:23 +0000 (11 14:53 +0200)
committerCharles Zhang <charleszhang99@yahoo.com>
Sat, 13 Apr 2024 11:13:03 +0000 (13 13:13 +0200)
treec505c14780a2cb3a127d31b02a62bebc692d278c
parent9cd33f2391f246cb3cafa1ec772116d6c9c7f954
debug-info: Use a packed debug fun representation.

This change significantly reduces the amount of space that debug-info takes
up in an image (about a 50% space reduction in total debug info space
usage). For example, the size of a cold image on an arm64 machine goes
down from 33 MB to 27 MB, and from 34 MB to 29 MB on x86-64.

Based closely on the long-ago-removed minimal debug fun representation
whose only vestiges remained as a block comment. (It was originally
removed as SBCL was being first bootstrapped due to package renaming
issues which are irrelevant now). The main difference with this new
implementation that this packed debug fun representation works on all
debug levels and so we are always able to pack debug funs into byte
vectors.

* COMPILED-DEBUG-FUN is now never dumped. This means there is no need
to have an additional layer of encoding in COMPILED-DEBUG-FUN, and we
can remove things like the :KIND hack and free up 7 fopcodes. The
tricks to do byte encoding previously are now subsumed by the packed
debug fun representation, where everything is byte-packed.

* Replace the test cross-checking the C and lisp implementations of
varint decoding with an end-to-end test demonstrating that the ldb
backtrace code produces the same debug fun names as the Lisp code,
making backtracing more robust to further changes to the debug fun
format.

* The disassembler code now includes local functions again, but it is
still based on PC ranges rather than names so that disassembling
different closures with the same name is correct still.
18 files changed:
NEWS
src/code/debug-info.lisp
src/code/debug-int.lisp
src/code/load.lisp
src/code/save.lisp
src/compiler/debug-dump.lisp
src/compiler/generic/genesis.lisp
src/compiler/target-disassem.lisp
src/runtime/backtrace.c
src/runtime/sprof.c
src/runtime/var-io.c
src/runtime/var-io.h
tests/arena.impure.lisp
tests/debug.pure.lisp
tests/elfcore.test.sh
tools-for-build/editcore.lisp
tools-for-build/elftool.lisp
xperfecthash63.lisp-expr