With `native-compile', compile lambdas in a defun or lambda too
This fixes bug#64646. Also refactor two functions to reduce
code duplication.
* lisp/emacs-lisp/comp.el (comp-spill-lap-function/symbol)
(comp-spill-lap-function/list): Add all functions found by the
byte compiler (including lambdas) to the native compiler's
context, thus making them be native compiled. Refactor to use
comp-intern-func-in-ctxt. Make comp-spill-lap-function/list
also compile closures.
* test/src/comp-resources/comp-test-funcs.el
(comp-tests-lambda-return-f2): New function
* test/src/comp-tests.el (comp-test-lambda-return2)
(comp-tests-free-fun-f2): New functions to test that internal
lambdas get native compiled.