[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 03/03: Micro-optimization of scm_vm placement in scm_thr
From: |
Andy Wingo |
Subject: |
[Guile-commits] 03/03: Micro-optimization of scm_vm placement in scm_thread |
Date: |
Fri, 14 Sep 2018 04:14:28 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit 8bb9ae3b51aa5f16b6b364f5212c0f3a82136a2f
Author: Andy Wingo <address@hidden>
Date: Fri Sep 14 09:39:29 2018 +0200
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 1969f87..7ebd377 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)