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: Does recent great work on separating the bytecode stack make it easier to show bytecode offsets in a traceback? Date: Mon, 2 May 2022 11:10:14 +0200 Message-ID: <9702547E-EEFE-45D9-B1A5-C434DD82678F@acm.org> References: Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13477"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Rocky Bernstein Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 02 11:19:16 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 1nlSD6-0003Ob-HB for ged-emacs-devel@m.gmane-mx.org; Mon, 02 May 2022 11:19:16 +0200 Original-Received: from localhost ([::1]:33808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nlSD5-0003ia-FW for ged-emacs-devel@m.gmane-mx.org; Mon, 02 May 2022 05:19:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52682) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlS4g-0000H8-AW for emacs-devel@gnu.org; Mon, 02 May 2022 05:10:36 -0400 Original-Received: from mail1456c50.megamailservers.eu ([91.136.14.56]:32848 helo=mail266c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlS4d-0002js-Tb for emacs-devel@gnu.org; Mon, 02 May 2022 05:10:33 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1651482617; bh=KXYTMzOtan0KF+FGDR5wP0nvkuK8ZOAAp2GDD/ld7sQ=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=PfJ6XMgNWEYVRSp5/P76Vt7lUVtv6v0cXF/V7jp+zW0KPJwZVDvOubuNpWLWPpT/7 orzU8+dadSAfAcJDF6nlNjEdwloRZ2tOY1YQRplRK20Ih7XaSoGHBo/88SKWrHtgx7 wCsZz0bqauvfTB5TMCgHnJRkwdzcsveyZvPhPG2U= 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 mail266c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 2429AEna018195; Mon, 2 May 2022 09:10:16 +0000 In-Reply-To: X-Mailer: Apple Mail (2.3654.120.0.1.13) X-CTCH-RefID: str=0001.0A742F21.626F9FF8.0068, 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.14.56; envelope-from=mattiase@acm.org; helo=mail266c50.megamailservers.eu X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665, T_SCC_BODY_TEXT_LINE=-0.01 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:289086 Archived-At: 30 apr. 2022 kl. 18.25 skrev Rocky Bernstein : > I especially like and appreciate the comment in the C code in = bytecode.c showing the Bytecode interpreter stack. Many thanks for your kind words. Mustn't let an opportunity for making = ASCII art go to waste! > Now that we have a more normal bytecode stack, we have "saved_pc" = shouldn't it be possible to easily show the bytecode offset in = lisp/emacs-lisp/backtrack.el ?=20 That information is indeed accessible now, at least in principle; the = stack format was designed with backtracing in mind. How to make = effective use of it is another matter. A bytecode offset to source = location mapping is perhaps more feasible now (with position-carrying = symbols) but still a fair amount of work. There are also questions about whether to carry around such a mapping = all the time (memory cost etc). I like the idea of rematerialising it = when needed but Elisp isn't easily conducive to that approach. On the other hand, just exposing the bytecode offset in tracebacks could = very well be useful on its own for users who can read disassembled = bytecode. Regarding the stack trace information, there is some redundancy that = could be exploited: the backtrace recorded in the specpdl could probably = be eliminated for calls into bytecode (and with some gymnastics, for = other calls as well). Experiments have indicated that there are = performance gains to be had here. > Prior work on this can be found in = https://lists.gnu.org/archive/html/emacs-devel/2020-07/msg00711.html Thank you, this provides some interesting perspective. Some things have = changed since but the big problems remain more or less the same.