1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-09 13:10:57 -08:00

Inline setcar and setcdr in byte-code interpreter

The function call overhead is nontrivial in comparison to the actual
code which makes this worthwhile.

* src/bytecode.c (exec_byte_code):
Inline code from Fsetcar and Fsetcdr.
This commit is contained in:
Mattias Engdegård 2021-12-31 16:47:56 +01:00
parent 6c000af611
commit ce1de3a8d9

View file

@ -26,6 +26,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include "keyboard.h"
#include "syntax.h"
#include "window.h"
#include "puresize.h"
/* Work around GCC bug 54561. */
#if GNUC_PREREQ (4, 3, 0)
@ -1409,15 +1410,23 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
CASE (Bsetcar):
{
Lisp_Object v1 = POP;
TOP = Fsetcar (TOP, v1);
Lisp_Object newval = POP;
Lisp_Object cell = TOP;
CHECK_CONS (cell);
CHECK_IMPURE (cell, XCONS (cell));
XSETCAR (cell, newval);
TOP = newval;
NEXT;
}
CASE (Bsetcdr):
{
Lisp_Object v1 = POP;
TOP = Fsetcdr (TOP, v1);
Lisp_Object newval = POP;
Lisp_Object cell = TOP;
CHECK_CONS (cell);
CHECK_IMPURE (cell, XCONS (cell));
XSETCDR (cell, newval);
TOP = newval;
NEXT;
}