unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Vibhav Pant <vibhavp@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
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	[thread overview]
Message-ID: <CA+T2Sh1ZmpqP81b8teWRSQWjY9r5Tf-cGh+Fa3UkGR4-+GmMAg@mail.gmail.com> (raw)
In-Reply-To: <jwvo9yg65av.fsf-monnier+emacsdiffs@gnu.org>

On Sun, Feb 5, 2017 at 8:44 PM, Stefan Monnier <monnier@iro.umontreal.ca> 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



  reply	other threads:[~2017-02-05 17:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170205102302.10649.95044@vcs.savannah.gnu.org>
     [not found] ` <20170205102302.97A0822014A@vcs.savannah.gnu.org>
2017-02-05 15:14   ` [Emacs-diffs] feature/byte-switch 44c95c5: bytecomp.el: Don't store non-keyword symbols in jump-tables Stefan Monnier
2017-02-05 17:24     ` Vibhav Pant [this message]
2017-02-05 17:50       ` Clément Pit-Claudel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+T2Sh1ZmpqP81b8teWRSQWjY9r5Tf-cGh+Fa3UkGR4-+GmMAg@mail.gmail.com \
    --to=vibhavp@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).