• Paul Eggert's avatar
    Hoist some byte-code checking out of eval · f0b0105d
    Paul Eggert authored
    Check Lisp_Compiled objects better as they’re created,
    so that the byte-code interpreter needn’t do the checks
    each time it executes them.  This improved performance
    of ‘make compile-always’ by 1.5% on my platform.  Also,
    improve the quality of the (still-incomplete) checks, as
    this is more practical now that they’re done less often.
    * src/alloc.c (make_byte_code): Remove.  All uses removed.
    (Fmake_byte_code): Put a better (though still incomplete)
    check here instead.  Simplify by using Fvector instead
    of make_uninit_vector followed by memcpy, and by using
    XSETPVECTYPE instead of make_byte_code followed by XSETCOMPILED.
    * src/bytecode.c (Fbyte_code): Do sanity check and conditional
    translation to unibyte here instead of each time the function is
    executed.
    (exec_byte_code): Omit no-longer-necessary sanity and
    unibyte checking.  Use SCHARS instead of SBYTES where
    either will do, as SCHARS is faster.
    * src/eval.c (fetch_and_exec_byte_code): New function.
    (funcall_lambda): Use it.
    (funcall_lambda, lambda_arity, Ffetch_bytecode):
    Omit no-longer-necessary sanity checks.
    (Ffetch_bytecode): Add sanity check if actually fetching.
    * src/lisp.h (XSETCOMPILED): Remove.  All uses removed.
    * src/lread.c (read1): Check byte-code objects more thoroughly,
    albeit still incompletely, and do translation to unibyte here
    instead of each time the function is executed.
    (read1): Use XSETPVECYPE instead of make_byte_code.
    (read_vector): Omit no-longer-necessary sanity check.
    f0b0105d
eval.c 127 KB