From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tom Tromey Newsgroups: gmane.emacs.devel Subject: please review new branch feature/byte-unwind-protect Date: Mon, 22 Jan 2018 22:20:36 -0700 Message-ID: <87inbtnobf.fsf@tromey.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1516684759 18481 195.159.176.226 (23 Jan 2018 05:19:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 23 Jan 2018 05:19:19 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 23 06:19:14 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1edqz4-0003UP-QC for ged-emacs-devel@m.gmane.org; Tue, 23 Jan 2018 06:18:59 +0100 Original-Received: from localhost ([::1]:36600 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edr13-0001Rt-9d for ged-emacs-devel@m.gmane.org; Tue, 23 Jan 2018 00:21:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56048) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edr0v-0001RN-OY for emacs-devel@gnu.org; Tue, 23 Jan 2018 00:20:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edr0r-0007qR-Pg for emacs-devel@gnu.org; Tue, 23 Jan 2018 00:20:53 -0500 Original-Received: from gateway34.websitewelcome.com ([192.185.148.140]:12631) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edr0r-0007XQ-HH for emacs-devel@gnu.org; Tue, 23 Jan 2018 00:20:49 -0500 Original-Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway34.websitewelcome.com (Postfix) with ESMTP id 453293746F3 for ; Mon, 22 Jan 2018 23:20:37 -0600 (CST) Original-Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id dr0feW4vKvkfxdr0fe1lNf; Mon, 22 Jan 2018 23:20:37 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From: Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=MD2dHhECccS8oug+id5hJlJlrlR7RYf3l+Yw3HwtE64=; b=REYowrlpuShIvIcezkM4anQn5V g1pILbTxcK+enskxpJg252dryMvn9j1T7rYwjfnSUZgPCJbzQ+ty5UE7TO/sscipB8Ma8+tlnL2jO SN95obZqF1FAUxpKgeCXwqltG; Original-Received: from 71-218-90-63.hlrn.qwest.net ([71.218.90.63]:48780 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1edr0f-001yp7-26; Mon, 22 Jan 2018 23:20:37 -0600 X-Attribution: Tom X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 71.218.90.63 X-Source-L: No X-Exim-ID: 1edr0f-001yp7-26 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 71-218-90-63.hlrn.qwest.net (bapiya) [71.218.90.63]:48780 X-Source-Auth: tom+tromey.com X-Email-Count: 1 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 192.185.148.140 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:222162 Archived-At: Hi. I recently wrote a couple of patches to add two new bytecodes to Emacs. These make it possible to compile unwind-protect without the need to introduce a closure for the unwind forms. I've pushed these to feature/byte-unwind-protect. They seem to be working pretty well, so I would appreciate a review. I'd like to merge these to trunk. The first patch changes the C code so that a CATCHER_ALL handler sees both signals and throws. In addition to being needed for the second patch, this allowed some simplifications in the module code. Note that this changes the interface exposed by internal_catch_all, but as there is only one caller, it is easy to verify that the change doesn't matter. The second patch adds the new bytecodes and updates the byte compiler. Two bytecodes are added. The first, Bpushunwindprotect, pushes a CATCHER_ALL handler. On error, it then pushes the exception value and `t' and jumps to the unwind forms. When there is no error, the body form's value is left on the stack and then an additional `nil' is pushed. The second bytecode, Bendunwindprotect, looks at the top of the stack and decides whether to carry on or to call `signal' or `throw'. It's possible that this new bytecode could be used to remove the unwind-protect restrictions in generator.el, though I didn't look deeply into that. thanks, Tom