1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

Micro-optimization of scm_vm placement in scm_thread

* libguile/threads.h (struct scm_thread): Move the embedded "struct
  scm_vm" earlier in the scm_thread.  Since the VM (and the JIT) access
  VM data (SP, FP, etc) through the thread pointer, this allows more
  accesses to be encoded in shorter instruction sequences.
This commit is contained in:
Andy Wingo 2018-09-14 09:39:29 +02:00
parent 0ccd2d0d9e
commit 8bb9ae3b51

View file

@ -49,6 +49,9 @@ struct scm_thread_wake_data;
struct scm_thread { struct scm_thread {
struct scm_thread *next_thread; struct scm_thread *next_thread;
/* VM state for this thread. */
struct scm_vm vm;
SCM handle; SCM handle;
scm_i_pthread_t pthread; scm_i_pthread_t pthread;
@ -104,9 +107,6 @@ struct scm_thread {
/* JIT state; NULL until this thread needs to JIT-compile something. */ /* JIT state; NULL until this thread needs to JIT-compile something. */
struct scm_jit_state *jit_state; struct scm_jit_state *jit_state;
/* VM state for this thread. */
struct scm_vm vm;
}; };
#define SCM_I_IS_THREAD(x) SCM_SMOB_PREDICATE (scm_tc16_thread, x) #define SCM_I_IS_THREAD(x) SCM_SMOB_PREDICATE (scm_tc16_thread, x)