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: [Emacs-diffs] feature/byte-switch 44c95c5: bytecomp.el: Don't store non-keyword symbols in jump-tables. Date: Sun, 5 Feb 2017 22:54:42 +0530 Message-ID: References: <20170205102302.10649.95044@vcs.savannah.gnu.org> <20170205102302.97A0822014A@vcs.savannah.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: blaine.gmane.org 1486315521 14640 195.159.176.226 (5 Feb 2017 17:25:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 5 Feb 2017 17:25:21 +0000 (UTC) Cc: "emacs-devel@gnu.org" To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 05 18:25:18 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 1caQYt-0003Xg-PJ for ged-emacs-devel@m.gmane.org; Sun, 05 Feb 2017 18:25:15 +0100 Original-Received: from localhost ([::1]:43944 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1caQYz-0007ud-6J for ged-emacs-devel@m.gmane.org; Sun, 05 Feb 2017 12:25:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42947) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1caQYP-0007uL-09 for emacs-devel@gnu.org; Sun, 05 Feb 2017 12:24:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1caQYO-0004f1-4H for emacs-devel@gnu.org; Sun, 05 Feb 2017 12:24:45 -0500 Original-Received: from mail-yw0-x230.google.com ([2607:f8b0:4002:c05::230]:36410) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1caQYO-0004ek-0R for emacs-devel@gnu.org; Sun, 05 Feb 2017 12:24:44 -0500 Original-Received: by mail-yw0-x230.google.com with SMTP id v200so37874172ywc.3 for ; Sun, 05 Feb 2017 09:24:43 -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=U3qAh21XOmf4IaoRl+6LNAcE+BkFULBVm9x8hdLaZHg=; b=GxI2FJHhE2VpjSleUCFDoW/mflpfBHL2ydmGUtCSab961MQHkdQpcA1BJBKApLQVmX PycRxjDrYIGDvqSzbXAezbG60LZcqeLy10NaPCrAFBHfAltFUEStOqyfLhWb+dR6fM59 nwrESMwhLp8t+raQM8a/zlaR2fVVsvi1x1ui0UShM9BwS/RpkqITeR3SFGvWtwEG/61f KhOGfscsb6ggOWM8/G2y098JC3BHmt27SCUDPdU7Uh5crLeMHcQ+3eqF1esUK0V8uAWk I0tSoR0A0NSGymFp2ExRSosysS+oh6y2CXzf4ku/N5AZhqGETiObx/LQzJqW4narWplZ p2Jw== 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=U3qAh21XOmf4IaoRl+6LNAcE+BkFULBVm9x8hdLaZHg=; b=bI62KkcZ3sg8tg/H5rKhyKT17fmwvxXKrgFJKIic+mBtuRwbjzNUca2FZ49aem6Uux H6TO+czIl6bKLhEe9m7ymu8UOuZbAsxl0MwO+ul1F0ehaXiFhbHCtiVj45NvY9aJ3A/Y nMjOCWQry9rCm9C/2gnzmYsZ959KnruZe41q1sTLsFHHilAow7ZdTDW5REGFm/7UZh2o HMZHaCSdrZ1wnoI2La6Fg3CYv2uEAcR1mGRxtIbnqO4VAaSzY0/+wGszjpSJDMoCzYDY vYY4E0/ioMSP/E3mLsPp7VUQAI0eDVXmUe/VzlK+QRJyYlHiuaE1eY4M47haUk4Z655B rGkQ== X-Gm-Message-State: AIkVDXLA1thjS4sBva2I7ffuzK88P9cIsxIP0SPqU7p79KKwT3K++da/S8Lg14p9sFW3d1fyuidw6tt3C+D/TA== X-Received: by 10.13.252.131 with SMTP id m125mr4913218ywf.49.1486315483135; Sun, 05 Feb 2017 09:24:43 -0800 (PST) Original-Received: by 10.129.153.77 with HTTP; Sun, 5 Feb 2017 09:24:42 -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:c05::230 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:212001 Archived-At: On Sun, Feb 5, 2017 at 8:44 PM, Stefan Monnier wrote: > I suggest you document the property that you need this to satisfy. > E.g. something like "OBJ is a constant expression whose value can be > compared with `eq`" or something like that. And you might like to see if > maybe you can use macroexp-const-p in here (there are many different > definitions of "constant", tho). macroexp-const-p seems to be a much better alternative to this. I've replaced byte-compile-cond-valid-obj2-p altogether with this. It seems to return non-nil for constant expressions that would work in a jump table implementation. At some point, I would like to extend this to forms that call functions, but that would need additional code to make sure that the callee function doesn't modify the value of the variable we're comparing against (is there some way to do that already?). Thanks, Vibhav -- Vibhav Pant vibhavp@gmail.com