(SETF %FUN-NAME) on closures, now with fewer restrictions.
commit3816b8dc8680c17c850f55bde86ff9268480b57d
authorDouglas Katzman <dougk@google.com>
Wed, 4 Oct 2017 18:49:55 +0000 (4 14:49 -0400)
committerDouglas Katzman <dougk@google.com>
Wed, 4 Oct 2017 18:55:39 +0000 (4 14:55 -0400)
tree54a4c98ce528d603d9eb7819f835fcbd566824aa
parent34dcac9de3753c8234ec1389153801728f0e6e48
(SETF %FUN-NAME) on closures, now with fewer restrictions.

Any closure can be given a name, via a global hashtable.
But the special case of storing the name in the closure is used if either
it had a spare slot, or the namer does not require preserving identity.

The limitation still exists that the debugger does not see closure
names in a backtrace unless the creator of the closure contained
   (DECLARE (OPTIMIZE SB-C::STORE-CLOSURE-DEBUG-POINTER))
Otherwise we lose the backpointer from the simple-fun to the
closure that invoked it. I think that's a separate concern.

Also:
- rewrite %FUN-NAME and (SETF %FUN-NAME) to be less ugly and
  dispatch on type more efficiently.
- use SB-MOP:GENERIC-FUNCTION-NAME instead of SLOT-VALUE.
- explain a fixme in gc-common
TODO
src/code/early-extensions.lisp
src/code/target-misc.lisp
src/cold/defun-load-or-cload-xcompiler.lisp
src/compiler/deftype.lisp
src/compiler/generic/vm-fndb.lisp
src/compiler/info-functions.lisp
src/pcl/low.lisp
src/runtime/gc-common.c
tests/debug.impure.lisp
tests/fun-names.pure.lisp [new file with mode: 0644]