From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Vibhav Pant Newsgroups: gmane.emacs.devel Subject: Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables. Date: Sun, 12 Feb 2017 08:40:02 +0530 Message-ID: References: <1b07c68a-873e-83c8-246d-423bc83a3881@gmail.com> <712df469-190d-aeab-e239-1f225be3333f@gmail.com> <25a6003d-1d9b-381f-29b0-aece30af1def@gmail.com> <87379c26-6116-a45d-8205-b9d00e8b6c90@cs.ucla.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: blaine.gmane.org 1486869063 5752 195.159.176.226 (12 Feb 2017 03:11:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 12 Feb 2017 03:11:03 +0000 (UTC) Cc: "emacs-devel@gnu.org" To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 12 04:10:57 2017 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 1cckYz-00013r-CG for ged-emacs-devel@m.gmane.org; Sun, 12 Feb 2017 04:10:57 +0100 Original-Received: from localhost ([::1]:50531 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cckZ4-0002LL-Jq for ged-emacs-devel@m.gmane.org; Sat, 11 Feb 2017 22:11:02 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cckYT-0002L2-Is for emacs-devel@gnu.org; Sat, 11 Feb 2017 22:10:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cckYS-0001Jj-Aj for emacs-devel@gnu.org; Sat, 11 Feb 2017 22:10:25 -0500 Original-Received: from mail-yb0-x244.google.com ([2607:f8b0:4002:c09::244]:35519) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cckYS-0001JY-5C for emacs-devel@gnu.org; Sat, 11 Feb 2017 22:10:24 -0500 Original-Received: by mail-yb0-x244.google.com with SMTP id j82so2724453ybg.2 for ; Sat, 11 Feb 2017 19:10:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=aUl5k8lAvJIA5yIGVdOwvYyEEQzMfPyjKITYJ3kAbz4=; b=nx286AXgEBf5HR5DfpiKhWOEJ2qqsNUiI2/YkDcj69tpMcNQSUpcfpx5ArTOkh4UON MQUj5CzJ8VxIbYOTpA9oL2JF8LJuWH085tDepXuj82duM/63d8srkiMOu2WPZJbPi5Fx QAsP70oQPUPLIHzHVpPtCwfMrh5+IZYMt0o0XBUusP9UHNHGy/NLs2hw8KKJwYkIMfl7 XUILptSBMFDyDsc3aVKfDjcRrzZzVWOvvDGh19FpOFeJAMM8pDCutMqz71HyDfR2fx/x h1T0CFBCVOuRSofqa+sJ/RK3I7zPMkQuVDm15vLY/9PDpZ7YVKygxCos7YaK4zRmeJ+r FaAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=aUl5k8lAvJIA5yIGVdOwvYyEEQzMfPyjKITYJ3kAbz4=; b=YP+7FCuerclna21zBpBHECLpQQMuaUP+VORWaxQ8VkMvbELKU7jVphBHelrQ2PT5/E xKLhy7VLr/aWjiPcIvZ/XkwZQWAjon7xV0dgCjtX0NaXr5Y/an/vbQWbwU1wIJHlKjIT DIQXUzcySuGPzNoVXbHwoE+i8BgPgmlUl3eMWQeNa9IQY3WMbjWK++EMDP9zVnjXxnio upZotQzofvNrO+WgdbwWF7g5L2fOZll613ZUF8M2xv5C2tEq5UUNiDHfJ5xuji+qUKz2 TRAliOrjB+PCnokPKKQHB0Mjw8rYMxounP8apSqVQ+eQwSOsp4oBEPbCIpKmRYHAhpFv KdiQ== X-Gm-Message-State: AMke39m5zNfesAavcz3+B5LsEb5GnDc0Aoho3ao7UMll6k4T6YKp0ggTwOuO51oNtl1xNk6bALmgklfGDSYCGg== X-Received: by 10.37.11.143 with SMTP id 137mr12207302ybl.35.1486869023351; Sat, 11 Feb 2017 19:10:23 -0800 (PST) Original-Received: by 10.129.153.77 with HTTP; Sat, 11 Feb 2017 19:10:02 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4002:c09::244 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:212257 Archived-At: Is there anything else to be done? On Sat, Feb 11, 2017 at 8:37 PM, Vibhav Pant wrote: > On Sat, Feb 11, 2017 at 2:17 AM, Paul Eggert wrote: >> On 02/10/2017 10:25 AM, Vibhav Pant wrote: >>> >>> Are there any other issues before I merge this into master? >> >> >> For the C code, please use the usual style: space before paren in calls, GNU >> style indenting for curly braces, "/* " at start of comments, main operator >> like "||" at start of next line rather than at end of previous line. >> >> One of the 'if's is overparenthesized, i.e., "if ((E))" where E is an >> ordinary expression and "if (E)" will do. >> >> Prefer "if (BYTE_CODE_SAFE)" to "#ifdef BYTE_CODE_SAFE", as these days it's >> better to avoid the preprocessor when it's easy. >> >> This comment: >> >> /* Hash tables for switch are declared with :size set to >> the >> exact number of cases, thus >> HASH_TABLE_SIZE (h) == h->count. */ >> >> is something that could be checked, no? Perhaps replace the comment with "if >> (BYTE_CODE_SAFE) eassert (HASH_TABLE_SIZE (h) == h->count);" and do the >> latter even with large hash tables? > Done. >> >> If you change the loop from "for (i = 0; i < h->count; i++)" to "for (i = >> h->count; 0 <= --i; )", then you can merge the two copies of "op = XINT >> (HASH_VALUE (h, i)); goto ob_branch;" into one copy that is after the >> surrounding "if". >> > > Done, thanks. > > > -- > Vibhav Pant > vibhavp@gmail.com -- Vibhav Pant vibhavp@gmail.com