summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2013-08-17 06:38:53 -0400
committerAndy Wingo <wingo@pobox.com>2013-08-24 15:27:50 +0200
commit84cc4127bd765719b2c502de4127a54867355ad5 (patch)
tree8443876e70cb6f670dd74f2bb4c2b140a1cab67f
parentadb8d905df01b91f9889af3b94571bf8b7db0f44 (diff)
downloadguile-84cc4127bd765719b2c502de4127a54867355ad5.tar.gz
RTL: 'return-values' instruction assumes 'reset-frame' has been called.
* libguile/vm-engine.c (return-values): Remove NVALUES operand. Don't reset the frame. * test-suite/tests/rtl.test ("cached-toplevel-set!"): Adapt to the fact that 'return-values' has no operand now, and that 'reset-frame' must be done first.
-rw-r--r--libguile/vm-engine.c11
-rw-r--r--test-suite/tests/rtl.test3
2 files changed, 6 insertions, 8 deletions
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c
index 0f8fed359..f2944e1cf 100644
--- a/libguile/vm-engine.c
+++ b/libguile/vm-engine.c
@@ -1087,22 +1087,19 @@ RTL_VM_NAME (SCM vm, SCM program, SCM *argv, size_t nargs_)
RETURN_ONE_VALUE (LOCAL_REF (src));
}
- /* return-values nvalues:24
+ /* return-values _:24
*
* Return a number of values from a call frame. This opcode
* corresponds to an application of `values' in tail position. As
* with tail calls, we expect that the values have already been
* shuffled down to a contiguous array starting at slot 1.
+ * We also expect the frame has already been reset.
*/
- VM_DEFINE_OP (6, return_values, "return-values", OP1 (U8_U24))
+ VM_DEFINE_OP (6, return_values, "return-values", OP1 (U8_X24))
{
- scm_t_uint32 nvalues;
+ scm_t_uint32 nvalues _GL_UNUSED = FRAME_LOCALS_COUNT();
SCM *base = fp;
- SCM_UNPACK_RTL_24 (op, nvalues);
-
- RESET_FRAME (nvalues + 1);
-
VM_HANDLE_INTERRUPTS;
ip = SCM_FRAME_RTL_MV_RETURN_ADDRESS (fp);
fp = vp->fp = SCM_FRAME_DYNAMIC_LINK (fp);
diff --git a/test-suite/tests/rtl.test b/test-suite/tests/rtl.test
index 6f61f375f..a6467ea77 100644
--- a/test-suite/tests/rtl.test
+++ b/test-suite/tests/rtl.test
@@ -242,7 +242,8 @@
(box-ref 2 1)
(add1 2 2)
(box-set! 1 2)
- (return-values 0)
+ (reset-frame 1)
+ (return-values)
(end-arity)
(end-program)))))
((make-top-incrementor))