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

add wind-fluids, unwind-fluids VM ops

* libguile/vm-i-system.c (wind-fluids, unwind-fluids): New instructions,
  for dynamic binding.
This commit is contained in:
Andy Wingo 2010-02-18 18:42:54 +01:00
parent d7c53a8695
commit e084b27e79

View file

@ -1532,6 +1532,28 @@ VM_DEFINE_INSTRUCTION (87, unwind, "unwind", 0, 0, 0)
NEXT;
}
VM_DEFINE_INSTRUCTION (90, wind_fluids, "wind-fluids", 1, -1, 0)
{
unsigned n = FETCH ();
SCM wf;
if (sp - 2*n < SCM_FRAME_UPPER_ADDRESS (fp))
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_set_dynwinds (scm_cons (wf, scm_i_dynwinds ()));
NEXT;
}
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);
NEXT;
}
/*