From: Andrea Corallo Date: Sun, 15 Sep 2019 13:41:42 +0000 (+0200) Subject: modify callref format to explicitate mvars X-Git-Tag: emacs-28.0.90~2727^2~1162 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=747c6a0dc8e53d66c785500d122957f4a17a9325;p=emacs.git modify callref format to explicitate mvars --- diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 21a80c04725..615d34268aa 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -425,7 +425,10 @@ If INPUT is a string this is the file path to be compiled." (defun comp-callref (func &rest args) "Emit a call usign narg abi for FUNC with ARGS." (comp-add-subr-to-relocs func) - `(callref ,func ,@args)) + `(callref ,func ,@(cl-loop with (nargs off) = args + repeat nargs + for sp from off + collect (comp-slot-n sp)))) (cl-defun make-comp-mvar (&key slot (constant nil const-vld) type) (when const-vld diff --git a/src/comp.c b/src/comp.c index 1c201c16c93..f2733625b51 100644 --- a/src/comp.c +++ b/src/comp.c @@ -1143,11 +1143,12 @@ emit_limple_call (Lisp_Object insn) static gcc_jit_rvalue * emit_limple_call_ref (Lisp_Object insn) { - /* Ex: (callref Fplus 2 0). */ + /* Ex: (callref < #s(comp-mvar 1 6 nil nil nil t) + #s(comp-mvar 2 11 t 10 integer t)). */ Lisp_Object callee = FIRST (insn); - EMACS_UINT nargs = XFIXNUM (SECOND (insn)); - EMACS_UINT base_ptr = XFIXNUM (THIRD (insn)); + EMACS_UINT nargs = XFIXNUM (Flength (CDR (CDR (insn)))); + EMACS_UINT base_ptr = XFIXNUM (FUNCALL1 (comp-mvar-slot, THIRD (insn))); return emit_call_ref (callee, nargs, comp.frame[base_ptr]); }