1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-11 16:20:19 +02:00

vm caches the dynamic state in a local var

* libguile/vm-engine.c (vm_engine): Cache the dynamic state in a local
  var when we enter the VM.
* libguile/vm-i-system.c (wind-fluids, unwind-fluids): Use the cached
  dynamic state instead of going through SCM_I_CURRENT_THREAD.
This commit is contained in:
Andy Wingo 2010-02-19 11:37:42 +01:00
parent 6e84cb95b1
commit 26e6f99fc3
2 changed files with 3 additions and 2 deletions

View file

@ -47,6 +47,7 @@ VM_NAME (SCM vm, SCM program, SCM *argv, int nargs)
SCM *objects = NULL; /* constant objects */
size_t object_count = 0; /* length of OBJECTS */
SCM *stack_limit = vp->stack_limit; /* stack limit address */
SCM dynstate = SCM_I_CURRENT_THREAD->dynamic_state;
/* Internal variables */
int nvalues = 0;

View file

@ -1539,7 +1539,7 @@ VM_DEFINE_INSTRUCTION (90, wind_fluids, "wind-fluids", 1, -1, 0)
goto vm_error_stack_underflow;
wf = scm_i_make_with_fluids (n, sp + 1 - 2*n, sp + 1 - n);
scm_i_swap_with_fluids (wf, SCM_I_CURRENT_THREAD->dynamic_state);
scm_i_swap_with_fluids (wf, dynstate);
scm_i_set_dynwinds (scm_cons (wf, scm_i_dynwinds ()));
NEXT;
}
@ -1549,7 +1549,7 @@ VM_DEFINE_INSTRUCTION (91, unwind_fluids, "unwind-fluids", 0, 0, 0)
SCM wf;
wf = scm_car (scm_i_dynwinds ());
scm_i_set_dynwinds (scm_cdr (scm_i_dynwinds ()));
scm_i_swap_with_fluids (wf, SCM_I_CURRENT_THREAD->dynamic_state);
scm_i_swap_with_fluids (wf, dynstate);
NEXT;
}