]> git.eshelyaron.com Git - emacs.git/commitdiff
modify callref format to explicitate mvars
authorAndrea Corallo <akrl@sdf.org>
Sun, 15 Sep 2019 13:41:42 +0000 (15:41 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:37:49 +0000 (11:37 +0100)
lisp/emacs-lisp/comp.el
src/comp.c

index 21a80c047251f6adec1e6f99895faa07c259ebcd..615d34268aaa3754a460813c8ea6cd14a4a272d0 100644 (file)
@@ -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
index 1c201c16c933ada6573075e7352698a80ff6f8ab..f2733625b516fed8ef7334f7f4cd93e020daccc4 100644 (file)
@@ -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]);
 }