summaryrefslogtreecommitdiff
path: root/src/bytecode.c
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2022-06-24 11:48:42 +0200
committerMattias EngdegÄrd <mattiase@acm.org>2022-06-24 11:48:42 +0200
commit253a4a2c689d757cb798cfb9f51b2110283d7146 (patch)
tree4102db0afea99357de76e305f26e6b28c4fbcacc /src/bytecode.c
parent0c784a483f98d6bea4d955a99bbf5ea6faf80acf (diff)
downloademacs-253a4a2c689d757cb798cfb9f51b2110283d7146.tar.gz
emacs-253a4a2c689d757cb798cfb9f51b2110283d7146.tar.bz2
emacs-253a4a2c689d757cb798cfb9f51b2110283d7146.zip
Bytecode opcode comments update
This is a cosmetic change only; there is no change in behaviour. * lisp/emacs-lisp/bytecomp.el: * src/bytecode.c (BYTE_CODES, exec_byte_code): Update and/or remove incorrect, outdated or useless comments. Clarify. Reorder where appropriate. Rename Bsave_current_buffer to Bsave_current_buffer_OBSOLETE and Bsave_current_buffer_1 to Bsave_current_buffer, reflecting the state since 1996.
Diffstat (limited to 'src/bytecode.c')
-rw-r--r--src/bytecode.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/bytecode.c b/src/bytecode.c
index fa068e1ec6b..d75767bb0c5 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -176,8 +176,8 @@ DEFINE (Bmin, 0136) \
DEFINE (Bmult, 0137) \
\
DEFINE (Bpoint, 0140) \
-/* Was Bmark in v17. */ \
-DEFINE (Bsave_current_buffer, 0141) /* Obsolete. */ \
+/* 0141 was Bmark in v17, Bsave_current_buffer in 18-19. */ \
+DEFINE (Bsave_current_buffer_OBSOLETE, 0141) /* Obsolete since 20. */ \
DEFINE (Bgoto_char, 0142) \
DEFINE (Binsert, 0143) \
DEFINE (Bpoint_max, 0144) \
@@ -194,7 +194,7 @@ DEFINE (Bbolp, 0156) \
DEFINE (Bbobp, 0157) \
DEFINE (Bcurrent_buffer, 0160) \
DEFINE (Bset_buffer, 0161) \
-DEFINE (Bsave_current_buffer_1, 0162) /* Replacing Bsave_current_buffer. */ \
+DEFINE (Bsave_current_buffer, 0162) \
/* 0163 was Bset_mark in v17. */ \
DEFINE (Binteractive_p, 0164) /* Obsolete since Emacs-24.1. */ \
\
@@ -924,8 +924,8 @@ exec_byte_code (Lisp_Object fun, ptrdiff_t args_template,
record_unwind_protect_excursion ();
NEXT;
- CASE (Bsave_current_buffer): /* Obsolete since ??. */
- CASE (Bsave_current_buffer_1):
+ CASE (Bsave_current_buffer_OBSOLETE): /* Obsolete since 20. */
+ CASE (Bsave_current_buffer):
record_unwind_current_buffer ();
NEXT;
@@ -1678,6 +1678,12 @@ exec_byte_code (Lisp_Object fun, ptrdiff_t args_template,
/* TODO: Perhaps introduce another byte-code for switch when the
number of cases is less, which uses a simple vector for linear
search as the jump table. */
+
+ /* TODO: Instead of pushing the table in a separate
+ Bconstant op, use an immediate argument (maybe separate
+ switch opcodes for 1-byte and 2-byte constant indices).
+ This would also get rid of some hacks that assume each
+ Bswitch to be preceded by a Bconstant. */
Lisp_Object jmp_table = POP;
if (BYTE_CODE_SAFE && !HASH_TABLE_P (jmp_table))
emacs_abort ();