emacs-devel
[Top][All Lists]
Advanced

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

Re: scratch/bytecode-speedup 1dca615cf9 08/11: Move a runtime interprete


From: Stefan Monnier
Subject: Re: scratch/bytecode-speedup 1dca615cf9 08/11: Move a runtime interpreter check to ENABLE_CHECKING
Date: Tue, 11 Jan 2022 12:22:49 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

> +  /* The byte code should have been properly pinned.  */
>    eassert (SDATA (bytestr) == bytestr_data);
> -
>    /* Binds and unbinds are supposed to be compiled balanced.  */
> -  if (SPECPDL_INDEX () != count)
> -    {
> -      if (SPECPDL_INDEX () > count)
> -     unbind_to (count, Qnil);
> -      error ("binding stack not balanced (serious byte compiler bug)");
> -    }
> +  eassert (SPECPDL_INDEX () == count);

This makes compiler debugging harder since it crashes Emacs instead of
signaling a clean error :-(

Maybe this actually should not be an error at all, and instead
`bytecomp.el` could skip emitting trailing `unbind`s and rely on
`exec_byte_code` doing the unbinds instead.

I think this would result in a speed up (and a more compact bytecode)
with dynbind code.  Not sure how it'd work out with lexbind code where
it's much more common for functions not to need any `unbind`.


        Stefan




reply via email to

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