1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-18 17:50:29 +02:00

Refactor handling of active VM registers

* libguile/threads.h (scm_thread): Remove unused jmp_buf regs member.
* libguile/vm.h (struct scm_vm): Rename resumable_prompt_cookie to just
  "registers"; we know it's a jmp_buf pointer.
* libguile/vm.c (scm_call_n):
* libguile/throw.c (catch):
* libguile/eval.c (eval):
* libguile/control.c (scm_suspendable_continuation_p): Adapt to cookie
  renaming.
This commit is contained in:
Andy Wingo 2018-06-27 18:21:04 +02:00
parent fd4eb14751
commit 18431e6e63
6 changed files with 14 additions and 15 deletions

View file

@ -86,7 +86,7 @@ catch (SCM tag, SCM thunk, SCM handler, SCM pre_unwind_handler)
scm_t_dynstack *dynstack = &t->dynstack;
scm_t_dynamic_state *dynamic_state = t->dynamic_state;
jmp_buf registers;
const void *prev_cookie;
jmp_buf *prev_registers;
ptrdiff_t saved_stack_depth;
if (!scm_is_eq (tag, SCM_BOOL_T) && !scm_is_symbol (tag))
@ -109,7 +109,7 @@ catch (SCM tag, SCM thunk, SCM handler, SCM pre_unwind_handler)
scm_c_vector_set_x (eh, 1, prompt_tag);
scm_c_vector_set_x (eh, 2, pre_unwind_handler);
prev_cookie = t->vm.resumable_prompt_cookie;
prev_registers = t->vm.registers;
saved_stack_depth = t->vm.stack_top - t->vm.sp;
/* Push the prompt and exception handler onto the dynamic stack. */
@ -128,7 +128,7 @@ catch (SCM tag, SCM thunk, SCM handler, SCM pre_unwind_handler)
/* A non-local return. */
SCM args;
t->vm.resumable_prompt_cookie = prev_cookie;
t->vm.registers = prev_registers;
scm_gc_after_nonlocal_exit ();
/* FIXME: We know where the args will be on the stack; we could