]> git.eshelyaron.com Git - emacs.git/commitdiff
remove comp-emit-funcall
authorAndrea Corallo <akrl@sdf.org>
Wed, 18 Sep 2019 09:55:25 +0000 (11:55 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:37:50 +0000 (11:37 +0100)
lisp/emacs-lisp/comp.el

index 8f93efd73ad03d82f92c4e1be6ba29548e9132a9..6463b02054c43d6ace03c691fa8c209607c01105 100644 (file)
@@ -625,38 +625,6 @@ If NEGATED non nil negate the tested condition."
               do (comp-emit-cond-jump var m-test 0 target-label nil)))
     (_ (error "Missing previous setimm while creating a switch"))))
 
-(defun comp-emit-funcall (narg)
-  "Avoid Ffuncall trampoline if possibile.
-NARG is the number of Ffuncall arguments."
-  (comp-stack-adjust (- narg))
-  (let* ((callee (comp-slot))
-         (callee-sym-name (comp-mvar-constant callee))
-         (optimize nil)
-         (callref nil))
-    (and (comp-mvar-const-vld callee)
-         (or (and (>= comp-speed 2)
-                  (eq callee-sym-name (comp-func-symbol-name comp-func))
-                  (setq optimize t)
-                  (setq callref (comp-nargs-p (comp-func-args comp-func))))
-             ;; (and (>= comp-speed 3)
-             ;;      (symbol-function callee-sym-name)
-             ;;      (subrp (symbol-function callee-sym-name))
-             ;;      (setq optimize t)
-             ;;      (setq callref (eq 'many
-             ;;                        (cdr (subr-arity
-             ;;                              (symbol-function callee-sym-name)))))
-             ;;      (setf callee-sym-name ))
-             ))
-    (if optimize
-        (if callref
-            (comp-emit-set-call (comp-callref callee-sym-name
-                                              narg (1+ (comp-sp))))
-          (comp-emit-set-call `(call ,callee-sym-name
-                                     ,@(cl-loop for i from (1+ (comp-sp))
-                                                repeat narg
-                                                collect (comp-slot-n i)))))
-      (comp-emit-set-call (comp-callref 'funcall (1+ narg) (comp-sp))))))
-
 (defmacro comp-op-case (&rest cases)
   "Expand CASES into the corresponding pcase.
 This is responsible for generating the proper stack adjustment when known and
@@ -722,7 +690,8 @@ the annotation emission."
                              (make-comp-mvar :constant arg)
                              (comp-slot+1))))
       (byte-call
-       (comp-emit-funcall arg))
+       (comp-stack-adjust (- arg))
+       (comp-emit-set-call (comp-callref 'funcall (1+ arg) (comp-sp))))
       (byte-unbind
        (comp-emit (comp-call 'helper_unbind_n
                              (make-comp-mvar :constant arg))))