From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Findirect_function Date: Fri, 14 Jan 2022 13:09:24 +0100 Message-ID: <69033893-9CEF-40D2-B10D-9702A37FDD2A@acm.org> References: <87tue61tz1.fsf@elite.giraud> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29479"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Manuel Giraud Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jan 14 13:11:49 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n8LQq-0007PQ-Kv for ged-emacs-devel@m.gmane-mx.org; Fri, 14 Jan 2022 13:11:48 +0100 Original-Received: from localhost ([::1]:42766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8LQp-0008Sh-JT for ged-emacs-devel@m.gmane-mx.org; Fri, 14 Jan 2022 07:11:47 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:53066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8LOh-0005uy-Ok for emacs-devel@gnu.org; Fri, 14 Jan 2022 07:09:37 -0500 Original-Received: from mail177c50.megamailservers.eu ([91.136.10.187]:55382 helo=mail51c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8LOe-0006ie-L4 for emacs-devel@gnu.org; Fri, 14 Jan 2022 07:09:35 -0500 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1642162167; bh=F/+XYjIdvz2vdzYDjHtN+crDcm0vghTrMai6Aa8mikA=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=fUUgQI0TTrCqhWaLoo+8msL+N+H3rCWymis9iX3q38hkD4zF7Gegj9VzJPkUQIhD1 15+4UuhI/U+T4EHsdV2MZChd/YefI/okwv8Ybsm1+2rMQF8vyXsRp2mdN7gv3Dw9ks RwGRjE9OrolN8O+d7PyfA6fg/cimJ+GZivQ0I7L0= Feedback-ID: mattiase@acm.or Original-Received: from smtpclient.apple (c188-150-171-71.bredband.tele2.se [188.150.171.71]) (authenticated bits=0) by mail51c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 20EC9Pi4023230; Fri, 14 Jan 2022 12:09:26 +0000 In-Reply-To: <87tue61tz1.fsf@elite.giraud> X-Mailer: Apple Mail (2.3654.120.0.1.13) X-CTCH-RefID: str=0001.0A742F26.61E167F7.001C, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-Origin-Country: SE Received-SPF: softfail client-ip=91.136.10.187; envelope-from=mattiase@acm.org; helo=mail51c50.megamailservers.eu X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:284743 Archived-At: 14 jan. 2022 kl. 11.40 skrev Manuel Giraud : > 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=E2=84=A2. 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 =3D XSYMBOL (result)->u.s.function, SYMBOLP = (result))) > result =3D indirect_function (result); > - if (!NILP (result)) > - return result; > =20 > - 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?