From 8bb9ae3b51aa5f16b6b364f5212c0f3a82136a2f Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Fri, 14 Sep 2018 09:39:29 +0200 Subject: [PATCH] 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. --- libguile/threads.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libguile/threads.h b/libguile/threads.h index 1969f8764..7ebd37789 100644 --- a/libguile/threads.h +++ b/libguile/threads.h @@ -49,6 +49,9 @@ struct scm_thread_wake_data; struct scm_thread { struct scm_thread *next_thread; + /* VM state for this thread. */ + struct scm_vm vm; + SCM handle; scm_i_pthread_t pthread; @@ -104,9 +107,6 @@ struct scm_thread { /* JIT state; NULL until this thread needs to JIT-compile something. */ 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)