summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2013-10-20 18:09:52 +0200
committerAndy Wingo <wingo@pobox.com>2013-10-20 18:09:52 +0200
commitd50370819a3a24fcc85554f6fa53b9a994e983d6 (patch)
tree8d36fecc777e1f7d98785e1b237de21a7304bba0
parent56de3a697617332b6738611fa0b926a8e9d996d7 (diff)
downloadguile-wip-rtl-prompts.tar.gz
Resumable partial continuations in the RTL VMwip-rtl-prompts
* libguile/vm-engine.c (receive-values): Bugfix for the case where we want an exact number of values. (abort): Advance the IP before capturing. The captured SP is fp - 1, not fp. * libguile/vm.c (vm_reinstate_partial_continuation): Don't push on a number-of-values marker.
-rw-r--r--libguile/vm-engine.c8
-rw-r--r--libguile/vm.c3
2 files changed, 9 insertions, 2 deletions
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c
index a251e101e..e45c5c447 100644
--- a/libguile/vm-engine.c
+++ b/libguile/vm-engine.c
@@ -1077,7 +1077,7 @@ RTL_VM_NAME (SCM vm, SCM program, SCM *argv, size_t nargs_)
VM_ASSERT (FRAME_LOCALS_COUNT () > proc + nvalues,
vm_error_not_enough_values ());
else
- VM_ASSERT (FRAME_LOCALS_COUNT () == proc + nvalues,
+ VM_ASSERT (FRAME_LOCALS_COUNT () == proc + 1 + nvalues,
vm_error_wrong_number_of_values (nvalues));
NEXT (2);
}
@@ -1393,9 +1393,13 @@ RTL_VM_NAME (SCM vm, SCM program, SCM *argv, size_t nargs_)
scm_t_uint32 nlocals = FRAME_LOCALS_COUNT ();
ASSERT (nlocals >= 2);
+ /* FIXME: Really we should capture the caller's registers. Until
+ then, manually advance the IP so that when the prompt resumes,
+ it continues with the next instruction. */
+ ip++;
SYNC_IP ();
vm_abort (vm, LOCAL_REF (1), nlocals - 2, &LOCAL_REF (2),
- SCM_EOL, &LOCAL_REF (1), &registers);
+ SCM_EOL, &LOCAL_REF (0), &registers);
/* vm_abort should not return */
abort ();
diff --git a/libguile/vm.c b/libguile/vm.c
index e287d6f39..7deaf54d6 100644
--- a/libguile/vm.c
+++ b/libguile/vm.c
@@ -350,8 +350,11 @@ vm_reinstate_partial_continuation (SCM vm, SCM cont, size_t n, SCM *argv,
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