Replace %CODE-ENTRY-POINTS with an array, remove %SIMPLE-FUN-NEXT.
commit143bba48aa68f6f80e8bae448276a85363838a8f
authorDouglas Katzman <dougk@google.com>
Sun, 4 Dec 2016 04:38:51 +0000 (3 23:38 -0500)
committerDouglas Katzman <dougk@google.com>
Sun, 4 Dec 2016 04:46:40 +0000 (3 23:46 -0500)
tree4ae1f7030e975185e97d0fb351f7514362d21fc5
parentb52331fc8cc5950b4dfd545d0e812c37a433f082
Replace %CODE-ENTRY-POINTS with an array, remove %SIMPLE-FUN-NEXT.

Rather than storing simple-funs as a linked list, code objects
hold all the relative addresses of embedded functions at the
beginning of the unboxed data, which has many advantages:

- C code is simpler and abstracted better.

- Function entry points are aligned to one more bit, because
  'struct simple_fun' is an even number of words now.

- On 64-bit architectures, code objects with only 1 simple fun are
  2 words shorter; and in all cases it is a strict size decrease.
  On 32-bit it is not a size improvement, but usually not worse;
  sometimes there is an additional padding word.

- There are fewer fixups to perform in trans_code()
  since entry points are stored as relative offsets.

%CODE-ENTRY-POINTS and %SIMPLE-FUN-NEXT still work, but
should not be used. Instead use (%CODE-ENTRY-POINT CODE N) to get
the Nth function, and (CODE-N-ENTRIES CODE) for the count.
In particular %SIMPLE-FUN-NEXT is really inefficient.
37 files changed:
contrib/sb-introspect/introspect.lisp
make-target-2-load.lisp
package-data-list.lisp-expr
src/code/alloc.lisp
src/code/debug-int.lisp
src/code/fop.lisp
src/code/immobile-code.lisp
src/code/kernel.lisp
src/code/print.lisp
src/code/room.lisp
src/code/stubs.lisp
src/code/target-load.lisp
src/code/target-misc.lisp
src/compiler/alpha/alloc.lisp
src/compiler/arm/alloc.lisp
src/compiler/arm64/alloc.lisp
src/compiler/arm64/system.lisp
src/compiler/codegen.lisp
src/compiler/dump.lisp
src/compiler/generic/genesis.lisp
src/compiler/generic/objdef.lisp
src/compiler/generic/target-core.lisp
src/compiler/hppa/alloc.lisp
src/compiler/mips/alloc.lisp
src/compiler/ppc/alloc.lisp
src/compiler/sparc/alloc.lisp
src/compiler/target-disassem.lisp
src/compiler/x86-64/target-insts.lisp
src/runtime/alloc.c
src/runtime/backtrace.c
src/runtime/gc-common.c
src/runtime/gc-internal.h
src/runtime/gencgc.c
src/runtime/marknsweepgc.c
src/runtime/print.c
src/runtime/purify.c
src/runtime/runtime.h