[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] feature/byte-switch 086c4ea: * src/bytecode.c: (exec_b

From: Vibhav Pant
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

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
<address@hidden> 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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]