From: Andrea Corallo Date: Wed, 18 Sep 2019 23:25:46 +0000 (+0200) Subject: guard comp-call-optim-form-call for byte compiled callee X-Git-Tag: emacs-28.0.90~2727^2~1148 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2cd60cb592930d985565612e0f22766b98fcf341;p=emacs.git guard comp-call-optim-form-call for byte compiled callee --- diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index ad64ee76183..551fdf80389 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -1301,27 +1301,27 @@ This can run just once." ;;; Call optimizer pass specific code. ;; Try to avoid funcall trampoline use when possible. -(defun comp-call-optim-form-call (calle args self) +(defun comp-call-optim-form-call (callee args self) "" - (let* ((f (symbol-function calle)) - (subrp (subrp f)) - (calle-in-unit (gethash calle - (comp-ctxt-funcs-h comp-ctxt)))) - (when-let* ((optimize (or (and subrp - (or - (not (subr-native-elispp f))) - ;; Attention speed 3 optimize inter compilation unit - ;; calls!! -) - (eq calle self) - (and (>= comp-speed 3) - calle-in-unit))) - (call-type (if (if subrp - (not (numberp (cdr (subr-arity f)))) - (comp-nargs-p calle-in-unit)) - 'callref - 'call))) - `(,call-type ,calle ,@args)))) + (when (symbolp callee) ; Do nothing if callee is a byte compiled func. + (let* ((f (symbol-function callee)) + (subrp (subrp f)) + (callee-in-unit (gethash callee + (comp-ctxt-funcs-h comp-ctxt)))) + (when-let* ((optimize (or (and subrp + (not (subr-native-elispp f))) + (eq callee self) + ;; Attention speed 3 optimize inter compilation + ;; unit calls!! + (and (>= comp-speed 3) + callee-in-unit))) + (call-type (if (if subrp + (not (numberp (cdr (subr-arity f)))) + (comp-nargs-p callee-in-unit)) + 'callref + 'call))) + (comp-add-subr-to-relocs callee) + `(,call-type ,callee ,@args))))) (defun comp-call-optim (funcs) "Given FUNCS try to avoid funcall trampoline usage when possible." diff --git a/src/comp.c b/src/comp.c index ca22b81de13..ef10c466cf2 100644 --- a/src/comp.c +++ b/src/comp.c @@ -1048,7 +1048,7 @@ emit_mvar_val (Lisp_Object mvar) if (FIXNUMP (constant)) { /* We can still emit directly objects that are selfcontained in a word - read (fixnums). */ + (read fixnums). */ emit_comment (SSDATA (Fprin1_to_string (constant, Qnil))); gcc_jit_rvalue *word = gcc_jit_context_new_rvalue_from_ptr(comp.ctxt,