diff options
author | Andy Wingo <wingo@pobox.com> | 2008-09-24 17:04:14 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2008-09-24 17:04:14 +0200 |
commit | bfffd2583cb95379f1b08fa8fe8019044a4c6bd0 (patch) | |
tree | add3ff0024b0986512ab367cc23d2007d57d78e9 /libguile/vm-engine.c | |
parent | 7bbed5181c562f771276e93480358d6512260dbf (diff) | |
download | guile-bfffd2583cb95379f1b08fa8fe8019044a4c6bd0.tar.gz |
make call/cc capture and restore the vm stacks
* libguile/continuations.c (scm_make_continuation): Capture VM
continuations as well, as their stack is outside the C stack.
(copy_stack): Reinstate VM stacks with the C stack.
* libguile/continuations.h (scm_t_contregs): Add a pointer for VM stacks.
A binary-incompatible change -- hopefully not too many people were
messing around with this struct, though.
* libguile/vm-engine.c (vm_run): Add a note about possibly maintaining a
stack of vms.
* libguile/vm.c (struct scm_vm_cont): New struct, distinct from scm_vm.
(vm_cont_mark, vm_cont_free, capture_vm_cont, reinstate_vm_cont):
Reorder some code, and fix some bad assumptions about what part of the
stack to copy; obviously this code was never used.
* libguile/vm.h:
* libguile/vm.c (scm_vm_capture_continuations)
(scm_vm_reinstate_continuations): New public functions, used by
continuations.c.
Diffstat (limited to 'libguile/vm-engine.c')
-rw-r--r-- | libguile/vm-engine.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c index 66d821329..7a6e30e99 100644 --- a/libguile/vm-engine.c +++ b/libguile/vm-engine.c @@ -82,7 +82,12 @@ vm_run (SCM vm, SCM program, SCM args) wind_data.fp = vp->fp; wind_data.this_frame = vp->this_frame; scm_dynwind_unwind_handler (vm_reset_stack, &wind_data, 0); - + + /* could do this if we reified all vm stacks -- for now, don't bother changing + *the-vm* + if (scm_fluid_ref (scm_the_vm_fluid) != vm) + scm_dynwind_fluid (scm_the_vm_fluid, vm); + */ #ifdef HAVE_LABELS_AS_VALUES /* Jump table */ |