diff options
| author | Mattias EngdegÄrd | 2022-03-14 12:57:29 +0100 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2022-03-17 16:38:22 +0100 |
| commit | 751c8f88c4faddb2b4f5d5ba3f051e8cd2c0153c (patch) | |
| tree | 73078523cc6c2343db46ff45c8189e1d75055c9a /src/thread.h | |
| parent | edb28bf669b890b7498cad0fd818ffa38b5e13a9 (diff) | |
| download | emacs-751c8f88c4faddb2b4f5d5ba3f051e8cd2c0153c.tar.gz emacs-751c8f88c4faddb2b4f5d5ba3f051e8cd2c0153c.zip | |
Put bytecode stack frame metadata in a struct
Using a plain C struct instead of type-punning Lisp_Object stack slots
makes the bytecode interpreter code more type-safe and potentially
faster (from better alias analysis), and the special-purpose accessors
are no longer needed. It also reduces the stack requirements when
using 64-bit Lisp_Object on 32-bit platforms.
* src/bytecode.c (enum stack_frame_index)
(sf_get_ptr, sf_set_ptr, sf_get_lisp_ptr, sf_set_lisp_ptr,
sf_get_saved_pc, sf_set_saved_pc): Remove.
(BC_STACK_SIZE): Now in bytes, not Lisp words.
(struct bc_frame): New.
(init_bc_thread, mark_bytecode, Finternal_stack_stats, valid_sp)
(exec_byte_code):
* src/lisp.h (struct handler, get_act_rec, set_act_rec):
Adapt to new struct bc_frame.
Diffstat (limited to 'src/thread.h')
| -rw-r--r-- | src/thread.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/thread.h b/src/thread.h index a29af702d13..ddba1a2d994 100644 --- a/src/thread.h +++ b/src/thread.h | |||
| @@ -35,9 +35,11 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 35 | 35 | ||
| 36 | /* Byte-code interpreter thread state. */ | 36 | /* Byte-code interpreter thread state. */ |
| 37 | struct bc_thread_state { | 37 | struct bc_thread_state { |
| 38 | Lisp_Object *fp; /* current frame pointer (see bytecode.c) */ | 38 | struct bc_frame *fp; /* current frame pointer */ |
| 39 | Lisp_Object *stack; | 39 | |
| 40 | Lisp_Object *stack_end; | 40 | /* start and end of allocated bytecode stack */ |
| 41 | char *stack; | ||
| 42 | char *stack_end; | ||
| 41 | }; | 43 | }; |
| 42 | 44 | ||
| 43 | struct thread_state | 45 | struct thread_state |