diff options
author | Andy Wingo <wingo@pobox.com> | 2013-11-15 15:39:38 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2013-11-15 15:39:38 +0100 |
commit | 840ec33422e7ccae5ac158584e5587d88ff42d85 (patch) | |
tree | e6e4b743559e02f309628b20107751206827d872 /libguile/vm.c | |
parent | 0c247a2fb6a9872b262eb7558e62481ac1967063 (diff) | |
download | guile-840ec33422e7ccae5ac158584e5587d88ff42d85.tar.gz |
Remove MVRA accessors in libguile
* libguile/vm.c (scm_i_vm_capture_stack): Remove MVRA argument, in
preparation for removing MVRA from frames.
(scm_i_capture_current_stack): Adapt to scm_i_vm_capture_stack
change.
(vm_reinstate_partial_continuation): Remove references to MVRA.
* libguile/vm.h (struct scm_vm_cont): Remove mvra member.
* libguile/vm-engine.c (call): Set MVRA to 0. Will remove later.
(return-values): Return to RA.
(call/cc): Remove MVRA from capture call.
* libguile/frames.c:
* libguile/frames.h (SCM_FRAME_MV_RETURN_ADDRESS)
(SCM_FRAME_RTL_MV_RETURN_ADDRESS, scm_frame_mv_return_address): Remove
accessors.
* libguile/control.c (reify_partial_continuation): Adapt to
scm_i_vm_capture_stack change.
Diffstat (limited to 'libguile/vm.c')
-rw-r--r-- | libguile/vm.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/libguile/vm.c b/libguile/vm.c index 5b3263993..07500e3ca 100644 --- a/libguile/vm.c +++ b/libguile/vm.c @@ -104,8 +104,7 @@ scm_i_vm_cont_print (SCM x, SCM port, scm_print_state *pstate) */ SCM scm_i_vm_capture_stack (SCM *stack_base, SCM *fp, SCM *sp, scm_t_uint8 *ra, - scm_t_uint8 *mvra, scm_t_dynstack *dynstack, - scm_t_uint32 flags) + scm_t_dynstack *dynstack, scm_t_uint32 flags) { struct scm_vm_cont *p; @@ -123,7 +122,6 @@ scm_i_vm_capture_stack (SCM *stack_base, SCM *fp, SCM *sp, scm_t_uint8 *ra, memset (p->stack_base, 0, p->stack_size * sizeof (SCM)); #endif p->ra = ra; - p->mvra = mvra; p->sp = sp; p->fp = fp; memcpy (p->stack_base, stack_base, (sp + 1 - stack_base) * sizeof (SCM)); @@ -146,10 +144,6 @@ vm_return_to_continuation (SCM vm, SCM cont, size_t n, SCM *argv) vp = SCM_VM_DATA (vm); cp = SCM_VM_CONT_DATA (cont); - if (n == 0 && !cp->mvra) - scm_misc_error (NULL, "Too few values returned to continuation", - SCM_EOL); - if (vp->stack_size < cp->stack_size + n + 4) scm_misc_error ("vm-engine", "not enough space to reinstate continuation", scm_list_2 (vm, cont)); @@ -183,7 +177,7 @@ vm_return_to_continuation (SCM vm, SCM cont, size_t n, SCM *argv) vp->sp++; *vp->sp = argv_copy[i]; } - vp->ip = cp->mvra; + vp->ip = cp->ra; } } @@ -198,7 +192,7 @@ scm_i_capture_current_stack (void) vm = scm_the_vm (); vp = SCM_VM_DATA (vm); - return scm_i_vm_capture_stack (vp->stack_base, vp->fp, vp->sp, vp->ip, NULL, + return scm_i_vm_capture_stack (vp->stack_base, vp->fp, vp->sp, vp->ip, scm_dynstack_capture_all (&thread->dynstack), 0); } @@ -342,19 +336,14 @@ vm_reinstate_partial_continuation (SCM vm, SCM cont, size_t n, SCM *argv, vp->sp = base - 1 + cp->stack_size; vp->fp = RELOC (cp->fp); - vp->ip = cp->mvra; + vp->ip = cp->ra; - /* now push args. ip is in a MV context. */ + /* Push the arguments. */ for (i = 0; i < n; i++) { vp->sp++; *vp->sp = argv_copy[i]; } -#if 0 - /* The number-of-values marker, only used by the stack VM. */ - vp->sp++; - *vp->sp = scm_from_size_t (n); -#endif /* The prompt captured a slice of the dynamic stack. Here we wind those entries onto the current thread's stack. We also have to |