emacs-devel
[Top][All Lists]
Advanced

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

Re: master f0b0105: Hoist some byte-code checking out of eval


From: Stefan Monnier
Subject: Re: master f0b0105: Hoist some byte-code checking out of eval
Date: Wed, 20 May 2020 19:21:44 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>> AFAIK this function is only used in the
>> extremely rare case that Elisp does
>>      (byte-code "blabla")
>> So I think some of the checks you removed from `exec_byte_code` will
>> simply not be performed any more (at least not on
>> `byte-code-function-p` objects).
>
> Thanks for reviewing the patch.
>
> What checks do you have in mind? Formerly, exec_byte_code did this:
>
>   CHECK_STRING (bytestr); 
>   CHECK_VECTOR (vector); 
>   CHECK_FIXNAT (maxdepth);
>   if (STRING_MULTIBYTE (bytestr)) 
>     bytestr = Fstring_as_unibyte (bytestr);
>
> Now, byte-code does this:
>
>   if (! (STRINGP (bytestr) && VECTORP (vector) && FIXNATP (maxdepth))) 
>     error ("Invalid byte-code");  
>
>   if (STRING_MULTIBYTE (bytestr)) 
>     bytestr = Fstring_as_unibyte (bytestr);
>
> and to my eye this does everything that exec_byte_code used to do.

My point is that 99% of the calls to `exec_byte_code` don't go through
`Fbyte_code`.


        Stefan




reply via email to

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