diff options
author | Andy Wingo <wingo@pobox.com> | 2013-11-21 18:50:12 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2013-11-21 18:50:12 +0100 |
commit | b85cd20f80c94e4bd8e62363cf509cc9e2f6ede9 (patch) | |
tree | b0e701a1f3ad063cd5e0c1bb65a77e9d03c8ddb0 /libguile/vm-engine.c | |
parent | 350930756c0d1968e6b526bc8900a77fe8e8af58 (diff) | |
download | guile-b85cd20f80c94e4bd8e62363cf509cc9e2f6ede9.tar.gz |
scm_call_n avoids double TLS lookup
* libguile/vm-engine.c (VM_NAME): Take the current thread as an
argument.
* libguile/vm.c (scm_i_capture_current_stack): Call thread_vm.
(thread_vm): New helper.
(scm_the_vm): Call thread_vm.
(scm_call_n): Call thread_vm. Avoids a double TLS lookup.
Diffstat (limited to 'libguile/vm-engine.c')
-rw-r--r-- | libguile/vm-engine.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c index b50751116..72bdd53aa 100644 --- a/libguile/vm-engine.c +++ b/libguile/vm-engine.c @@ -424,7 +424,8 @@ ((scm_t_uintptr) (ptr) % alignof_type (type) == 0) static SCM -VM_NAME (struct scm_vm *vp, SCM program, SCM *argv, size_t nargs_) +VM_NAME (scm_i_thread *current_thread, struct scm_vm *vp, + SCM program, SCM *argv, size_t nargs_) { /* Instruction pointer: A pointer to the opcode that is currently running. */ @@ -439,7 +440,6 @@ VM_NAME (struct scm_vm *vp, SCM program, SCM *argv, size_t nargs_) register scm_t_uint32 op; /* Cached variables. */ - scm_i_thread *current_thread = SCM_I_CURRENT_THREAD; scm_i_jmp_buf registers; /* used for prompts */ #ifdef HAVE_LABELS_AS_VALUES |