1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00

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.
This commit is contained in:
Andy Wingo 2013-11-21 18:50:12 +01:00
parent 350930756c
commit b85cd20f80
2 changed files with 23 additions and 13 deletions

View file

@ -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