From b85cd20f80c94e4bd8e62363cf509cc9e2f6ede9 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Thu, 21 Nov 2013 18:50:12 +0100 Subject: 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. --- libguile/vm-engine.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libguile/vm-engine.c') 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 -- cgit v1.2.3