From a815e5f19581344af5e143636039064a7fbe83ed Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 23 Dec 2016 21:13:58 -0800 Subject: Remove interpreter’s byte stack MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This improves performance overall on my benchmark on x86-64, since the interpreted program-counter resides in a machine register rather than in RAM. * etc/DEBUG, src/.gdbinit: Remove xbytecode GDB command, as there is no longer a byte stack to decode. * src/bytecode.c (struct byte_stack, byte_stack_list) (relocate_byte_stack): Remove. All uses removed. (FETCH): Simplify now that pc is now local (typically, in a register) and no longer needs to be relocated. (CHECK_RANGE): Remove. All uses now done inline, in a different way. (BYTE_CODE_QUIT): Remove; now done by op_relative_branch. (exec_byte_code): Allocate a copy of the function’s bytecode, so that there is no problem if GC moves it. * src/lisp.h (struct handler): Remove byte_stack member. All uses removed. * src/thread.c (unmark_threads): Remove. All uses removed. * src/thread.h (struct thread_state): Remove m_byte_stack_list member. All uses removed. m_stack_bottom is now the first non-Lisp field. --- src/thread.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'src/thread.c') diff --git a/src/thread.c b/src/thread.c index 0bb0b7e006a..560d2cfa74f 100644 --- a/src/thread.c +++ b/src/thread.c @@ -595,16 +595,6 @@ mark_threads (void) flush_stack_call_func (mark_threads_callback, NULL); } -void -unmark_threads (void) -{ - struct thread_state *iter; - - for (iter = all_threads; iter; iter = iter->next_thread) - if (iter->m_byte_stack_list) - relocate_byte_stack (iter->m_byte_stack_list); -} - static void @@ -716,7 +706,7 @@ If NAME is given, it must be a string; it names the new thread. */) struct thread_state *new_thread; Lisp_Object result; const char *c_name = NULL; - size_t offset = offsetof (struct thread_state, m_byte_stack_list); + size_t offset = offsetof (struct thread_state, m_stack_bottom); /* Can't start a thread in temacs. */ if (!initialized) @@ -725,7 +715,7 @@ If NAME is given, it must be a string; it names the new thread. */) if (!NILP (name)) CHECK_STRING (name); - new_thread = ALLOCATE_PSEUDOVECTOR (struct thread_state, m_byte_stack_list, + new_thread = ALLOCATE_PSEUDOVECTOR (struct thread_state, m_stack_bottom, PVEC_THREAD); memset ((char *) new_thread + offset, 0, sizeof (struct thread_state) - offset); @@ -940,7 +930,7 @@ static void init_primary_thread (void) { primary_thread.header.size - = PSEUDOVECSIZE (struct thread_state, m_byte_stack_list); + = PSEUDOVECSIZE (struct thread_state, m_stack_bottom); XSETPVECTYPE (&primary_thread, PVEC_THREAD); primary_thread.m_last_thing_searched = Qnil; primary_thread.m_saved_last_thing_searched = Qnil; -- cgit v1.2.3