1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

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.
This commit is contained in:
Mark H Weaver 2013-08-17 06:38:53 -04:00 committed by Andy Wingo
parent adb8d905df
commit 84cc4127bd
2 changed files with 6 additions and 8 deletions

View file

@ -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);

View file

@ -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))