]> git.eshelyaron.com Git - emacs.git/commit
Add native compiler dynamic scope support
authorAndrea Corallo <akrl@sdf.org>
Mon, 1 Jun 2020 11:47:29 +0000 (12:47 +0100)
committerAndrea Corallo <akrl@sdf.org>
Fri, 19 Jun 2020 07:04:49 +0000 (09:04 +0200)
commitc37b5446d1f8e567f97f5708008b14a80b6c6d65
tree5d93441b0375c399ee872bfcaaca2e4c94113e2f
parent5a55a845a7c426e82e8a6a6d02bc4a39992871e3
Add native compiler dynamic scope support

Add an initial implementation to support dynamic scope.  Arg
parsing/binding it's done using the existing code in use for
bytecode (no ad-hoc code is synthetized for that).

* src/lisp.h (struct Lisp_Subr): Add lambda_list field.
(SUBR_NATIVE_COMPILED_DYNP): New inliner.

* src/alloc.c (mark_object): Update for Add lambda_list field.

* src/eval.c (eval_sub, Ffuncall, funcall_lambda): Handle native
compiled dynamic scope

* src/comp.c (declare_lex_function): Rename from declare_function
and rework.
(declare_function): New function.
(make_subr): Handle daynamic scope

* src/pdumper.c (dump_subr): Update for lambda_list field.

* lisp/emacs-lisp/comp.el (comp-func): Remove args slot.
(comp-func-l, comp-func-d): New classes deriving from `comp-func'.
(comp-spill-lap-function): Rework.
(comp-prepare-args-for-top-level): New function.
(comp-emit-for-top-level, comp-emit-lambda-for-top-level): Make
use of `comp-prepare-args-for-top-level'.
(comp-limplify-top-level): Use `comp-func-l'.
(comp-limplify-function): Emit arg prologue only for dynamic
scoped functions.
(comp-call-optim-form-call): Use `comp-func-l'.
(comp-call-optim, comp-tco): Do not optimize dynamic scoped code.
lisp/emacs-lisp/comp.el
src/alloc.c
src/comp.c
src/eval.c
src/lisp.h
src/pdumper.c