diff options
| author | Mattias EngdegÄrd | 2021-12-31 16:47:56 +0100 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2022-01-24 11:41:46 +0100 |
| commit | ce1de3a8d9723305f48fd4527fbceaff3cec50ba (patch) | |
| tree | 5ce8757036ca4a65f9cb76e7d8efec8b33bff859 /src/bytecode.c | |
| parent | 6c000af611419745cc7f6c5ea1df1ed961cd6ec3 (diff) | |
| download | emacs-ce1de3a8d9723305f48fd4527fbceaff3cec50ba.tar.gz emacs-ce1de3a8d9723305f48fd4527fbceaff3cec50ba.zip | |
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.
Diffstat (limited to 'src/bytecode.c')
| -rw-r--r-- | src/bytecode.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/bytecode.c b/src/bytecode.c index c5c86ba8f05..37da0858ab4 100644 --- a/src/bytecode.c +++ b/src/bytecode.c | |||
| @@ -26,6 +26,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 26 | #include "keyboard.h" | 26 | #include "keyboard.h" |
| 27 | #include "syntax.h" | 27 | #include "syntax.h" |
| 28 | #include "window.h" | 28 | #include "window.h" |
| 29 | #include "puresize.h" | ||
| 29 | 30 | ||
| 30 | /* Work around GCC bug 54561. */ | 31 | /* Work around GCC bug 54561. */ |
| 31 | #if GNUC_PREREQ (4, 3, 0) | 32 | #if GNUC_PREREQ (4, 3, 0) |
| @@ -1409,15 +1410,23 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, | |||
| 1409 | 1410 | ||
| 1410 | CASE (Bsetcar): | 1411 | CASE (Bsetcar): |
| 1411 | { | 1412 | { |
| 1412 | Lisp_Object v1 = POP; | 1413 | Lisp_Object newval = POP; |
| 1413 | TOP = Fsetcar (TOP, v1); | 1414 | Lisp_Object cell = TOP; |
| 1415 | CHECK_CONS (cell); | ||
| 1416 | CHECK_IMPURE (cell, XCONS (cell)); | ||
| 1417 | XSETCAR (cell, newval); | ||
| 1418 | TOP = newval; | ||
| 1414 | NEXT; | 1419 | NEXT; |
| 1415 | } | 1420 | } |
| 1416 | 1421 | ||
| 1417 | CASE (Bsetcdr): | 1422 | CASE (Bsetcdr): |
| 1418 | { | 1423 | { |
| 1419 | Lisp_Object v1 = POP; | 1424 | Lisp_Object newval = POP; |
| 1420 | TOP = Fsetcdr (TOP, v1); | 1425 | Lisp_Object cell = TOP; |
| 1426 | CHECK_CONS (cell); | ||
| 1427 | CHECK_IMPURE (cell, XCONS (cell)); | ||
| 1428 | XSETCDR (cell, newval); | ||
| 1429 | TOP = newval; | ||
| 1421 | NEXT; | 1430 | NEXT; |
| 1422 | } | 1431 | } |
| 1423 | 1432 | ||