make call/cc capture and restore the vm stacks
authorAndy Wingo <wingo@pobox.com>
Wed, 24 Sep 2008 15:04:14 +0000 (17:04 +0200)
committerAndy Wingo <wingo@pobox.com>
Wed, 24 Sep 2008 15:04:14 +0000 (17:04 +0200)
commitbfffd2583cb95379f1b08fa8fe8019044a4c6bd0
treeadd3ff0024b0986512ab367cc23d2007d57d78e9
parent7bbed5181c562f771276e93480358d6512260dbf
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.
libguile/continuations.c
libguile/continuations.h
libguile/vm-engine.c
libguile/vm.c
libguile/vm.h