unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattiase@acm.org>
To: Manuel Giraud <manuel@ledu-giraud.fr>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: [PATCH] Findirect_function
Date: Fri, 14 Jan 2022 13:09:24 +0100	[thread overview]
Message-ID: <69033893-9CEF-40D2-B10D-9702A37FDD2A@acm.org> (raw)
In-Reply-To: <87tue61tz1.fsf@elite.giraud>

14 jan. 2022 kl. 11.40 skrev Manuel Giraud <manuel@ledu-giraud.fr>:

> Maybe it is bike shedding territory (and maybe I'm missing something)

Not at all, patches are always welcome!

> but here are two patches for Findirect_function and its usage. "make
> check" is the same and so far it works for me™.

The first change is straightforward:

> @@ -2380,10 +2380,8 @@ DEFUN ("indirect-function", Findirect_function, Sindirect_function, 1, 2, 0,
>    if (SYMBOLP (result) && !NILP (result)
>        && (result = XSYMBOL (result)->u.s.function, SYMBOLP (result)))
>      result = indirect_function (result);
> -  if (!NILP (result))
> -    return result;
>  
> -  return Qnil;
> +  return result;

Good! See if you can find more instances of this unfortunate pattern. Even if it makes no difference for the generated code (very likely), it obfuscates the source code.

The other changes are less obvious since they may introduce extra costs; some of these code paths are fairly hot. In addition, I'm giving part of the interpreter an overhaul so perhaps we could drop them for the time being. Do you agree?




  reply	other threads:[~2022-01-14 12:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-14 10:40 [PATCH] Findirect_function Manuel Giraud
2022-01-14 12:09 ` Mattias Engdegård [this message]
2022-01-14 13:00   ` Manuel Giraud
2022-01-14 12:16 ` Eli Zaretskii
2022-01-14 12:29 ` Andreas Schwab
2022-01-14 13:03   ` Manuel Giraud
2022-01-14 16:27 ` Stefan Monnier
2022-01-14 16:48   ` Manuel Giraud
2022-01-14 17:39     ` Stefan Monnier
2022-01-17 13:32       ` Manuel Giraud
2022-01-17 18:14         ` Stefan Monnier
2022-01-17 18:16         ` Stefan Monnier
2022-01-18  0:43           ` Po Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=69033893-9CEF-40D2-B10D-9702A37FDD2A@acm.org \
    --to=mattiase@acm.org \
    --cc=emacs-devel@gnu.org \
    --cc=manuel@ledu-giraud.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).