From: Andrea Corallo Date: Mon, 28 Dec 2020 11:59:12 +0000 (+0100) Subject: Reorder subr register function arguments to make some room X-Git-Tag: emacs-28.0.90~2727^2~202 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5a8622ba2c623c60fab5b2784d5f15eeebcf46f2;p=emacs.git Reorder subr register function arguments to make some room * src/comp.c (Fcomp__register_lambda, Fcomp__register_subr) (Fcomp__late_register_subr): Use a rest arg to pass 'doc_idx' and 'intspec' parameters. * lisp/emacs-lisp/comp.el (comp-emit-for-top-level) (comp-emit-lambda-for-top-level): Update. --- diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 2ca7c50045e..3b84569c458 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -1693,17 +1693,17 @@ the annotation emission." 'comp--late-register-subr 'comp--register-subr) (make-comp-mvar :constant name) + (make-comp-mvar :constant c-name) (car args) (cdr args) - (make-comp-mvar :constant c-name) (make-comp-mvar :constant - (let* ((h (comp-ctxt-function-docs comp-ctxt)) - (i (hash-table-count h))) - (puthash i (comp-func-doc f) h) - i)) - (make-comp-mvar :constant - (comp-func-int-spec f)) + (list + (let* ((h (comp-ctxt-function-docs comp-ctxt)) + (i (hash-table-count h))) + (puthash i (comp-func-doc f) h) + i) + (comp-func-int-spec f))) ;; This is the compilation unit it-self passed as ;; parameter. (make-comp-mvar :slot 0)))))) @@ -1734,15 +1734,17 @@ These are stored in the reloc data array." (puthash (comp-func-byte-func func) (make-comp-mvar :constant nil) (comp-ctxt-lambda-fixups-h comp-ctxt))) + (make-comp-mvar :constant (comp-func-c-name func)) (car args) (cdr args) - (make-comp-mvar :constant (comp-func-c-name func)) (make-comp-mvar - :constant (let* ((h (comp-ctxt-function-docs comp-ctxt)) - (i (hash-table-count h))) - (puthash i (comp-func-doc func) h) - i)) - (make-comp-mvar :constant (comp-func-int-spec func)) + :constant + (list + (let* ((h (comp-ctxt-function-docs comp-ctxt)) + (i (hash-table-count h))) + (puthash i (comp-func-doc func) h) + i) + (comp-func-int-spec func))) ;; This is the compilation unit it-self passed as ;; parameter. (make-comp-mvar :slot 0))))) diff --git a/src/comp.c b/src/comp.c index 52ebf92c500..ee8ae98e2ac 100644 --- a/src/comp.c +++ b/src/comp.c @@ -4925,13 +4925,14 @@ make_subr (Lisp_Object symbol_name, Lisp_Object minarg, Lisp_Object maxarg, } DEFUN ("comp--register-lambda", Fcomp__register_lambda, Scomp__register_lambda, - 7, 7, 0, + 6, 6, 0, doc: /* Register anonymous lambda. This gets called by top_level_run during the load phase. */) - (Lisp_Object reloc_idx, Lisp_Object minarg, Lisp_Object maxarg, - Lisp_Object c_name, Lisp_Object doc_idx, Lisp_Object intspec, - Lisp_Object comp_u) + (Lisp_Object reloc_idx, Lisp_Object c_name, Lisp_Object minarg, + Lisp_Object maxarg, Lisp_Object rest, Lisp_Object comp_u) { + Lisp_Object doc_idx = FIRST (rest); + Lisp_Object intspec = SECOND (rest); struct Lisp_Native_Comp_Unit *cu = XNATIVE_COMP_UNIT (comp_u); if (cu->loaded_once) return Qnil; @@ -4953,13 +4954,14 @@ This gets called by top_level_run during the load phase. */) } DEFUN ("comp--register-subr", Fcomp__register_subr, Scomp__register_subr, - 7, 7, 0, + 6, 6, 0, doc: /* Register exported subr. This gets called by top_level_run during the load phase. */) - (Lisp_Object name, Lisp_Object minarg, Lisp_Object maxarg, - Lisp_Object c_name, Lisp_Object doc_idx, Lisp_Object intspec, - Lisp_Object comp_u) + (Lisp_Object name, Lisp_Object c_name, Lisp_Object minarg, + Lisp_Object maxarg, Lisp_Object rest, Lisp_Object comp_u) { + Lisp_Object doc_idx = FIRST (rest); + Lisp_Object intspec = SECOND (rest); Lisp_Object tem = make_subr (SYMBOL_NAME (name), minarg, maxarg, c_name, doc_idx, intspec, comp_u); @@ -4982,16 +4984,15 @@ This gets called by top_level_run during the load phase. */) } DEFUN ("comp--late-register-subr", Fcomp__late_register_subr, - Scomp__late_register_subr, 7, 7, 0, + Scomp__late_register_subr, 6, 6, 0, doc: /* Register exported subr. This gets called by late_top_level_run during the load phase. */) - (Lisp_Object name, Lisp_Object minarg, Lisp_Object maxarg, - Lisp_Object c_name, Lisp_Object doc, Lisp_Object intspec, - Lisp_Object comp_u) + (Lisp_Object name, Lisp_Object c_name, Lisp_Object minarg, + Lisp_Object maxarg, Lisp_Object rest, Lisp_Object comp_u) { if (!NILP (Fequal (Fsymbol_function (name), Fgethash (name, Vcomp_deferred_pending_h, Qnil)))) - Fcomp__register_subr (name, minarg, maxarg, c_name, doc, intspec, comp_u); + Fcomp__register_subr (name, c_name, minarg, maxarg, type, rest, comp_u); Fremhash (name, Vcomp_deferred_pending_h); return Qnil; }