diff options
| author | Mattias EngdegÄrd | 2021-12-31 16:47:56 +0100 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2022-01-02 14:01:31 +0100 |
| commit | b43e4a184ff35c3cc6accb769f04e3d75bcb751b (patch) | |
| tree | 54c8127b436236030408019194acb8d737788ebb /src/bytecode.c | |
| parent | 5dd261282d28548609f9cfc9d63811fa02639549 (diff) | |
| download | emacs-b43e4a184ff35c3cc6accb769f04e3d75bcb751b.tar.gz emacs-b43e4a184ff35c3cc6accb769f04e3d75bcb751b.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 5d8842f40cb..5e7de2725a0 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) |
| @@ -1415,15 +1416,23 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, | |||
| 1415 | 1416 | ||
| 1416 | CASE (Bsetcar): | 1417 | CASE (Bsetcar): |
| 1417 | { | 1418 | { |
| 1418 | Lisp_Object v1 = POP; | 1419 | Lisp_Object newcar = POP; |
| 1419 | TOP = Fsetcar (TOP, v1); | 1420 | Lisp_Object cell = TOP; |
| 1421 | CHECK_CONS (cell); | ||
| 1422 | CHECK_IMPURE (cell, XCONS (cell)); | ||
| 1423 | XSETCAR (cell, newcar); | ||
| 1424 | TOP = newcar; | ||
| 1420 | NEXT; | 1425 | NEXT; |
| 1421 | } | 1426 | } |
| 1422 | 1427 | ||
| 1423 | CASE (Bsetcdr): | 1428 | CASE (Bsetcdr): |
| 1424 | { | 1429 | { |
| 1425 | Lisp_Object v1 = POP; | 1430 | Lisp_Object newcar = POP; |
| 1426 | TOP = Fsetcdr (TOP, v1); | 1431 | Lisp_Object cell = TOP; |
| 1432 | CHECK_CONS (cell); | ||
| 1433 | CHECK_IMPURE (cell, XCONS (cell)); | ||
| 1434 | XSETCDR (cell, newcar); | ||
| 1435 | TOP = newcar; | ||
| 1427 | NEXT; | 1436 | NEXT; |
| 1428 | } | 1437 | } |
| 1429 | 1438 | ||