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 086c4ea: * src/bytecode.c: (exec_byte_code) Use hash_lookup for Bswitch
Date: Thu, 19 Jan 2017 17:46:16 +0530	[thread overview]
Message-ID: <CA+T2Sh3yww1NF_pmhkD5FD56qsGC7WF=o+62pAvEKjaZMGTZ4w@mail.gmail.com> (raw)
In-Reply-To: <jwv37ggclak.fsf-monnier+emacsdiffs@gnu.org>

On another thought, `byte-switch` is used while compiling certain
`cond` forms. It
replaces the traditional goto-if-nil bytecode by using a hash table mapping
values to addresses/tags to be jumped to. Since `byte-switch` is essentially a
"dynamic" goto (in the sense that the address/tag cannot be known at
compile time),
wouldn't doing a runtime type check in the bytecode VM for what is  a
hash table lookup + goto have a significant performance penalty?

On Wed, Jan 18, 2017 at 11:18 PM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>>     * src/bytecode.c: (exec_byte_code) Use hash_lookup for Bswitch
>>     Fgethash type checks the provided table object, which is unnecessary
>>     for compiled bytecode.
>
> While it's true that we can cause a core dump of Emacs if we feed it an
> invalid .elc file, that's a "feature" I'd rather shrink rather
> than generalize.
>
>
>         Stefan



-- 
Vibhav Pant
vibhavp@gmail.com



  parent reply	other threads:[~2017-01-19 12:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170118171311.10996.72260@vcs.savannah.gnu.org>
     [not found] ` <20170118171311.A84EA220125@vcs.savannah.gnu.org>
2017-01-18 17:48   ` [Emacs-diffs] feature/byte-switch 086c4ea: * src/bytecode.c: (exec_byte_code) Use hash_lookup for Bswitch Stefan Monnier
2017-01-18 18:19     ` Vibhav Pant
2017-01-19 12:16     ` Vibhav Pant [this message]
2017-01-19 16:34       ` Stefan Monnier
2017-01-19 17:53         ` Vibhav Pant
2017-01-20  9:10     ` Daniel Colascione
2017-01-20 14:53       ` Stefan Monnier

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+T2Sh3yww1NF_pmhkD5FD56qsGC7WF=o+62pAvEKjaZMGTZ4w@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).