VM_DEFINE_INSTRUCTION (36, br_if, "br-if", 3, 0, 0)
{
- BR (scm_is_true_and_not_nil (*sp));
+ BR (scm_is_true (*sp));
}
VM_DEFINE_INSTRUCTION (37, br_if_not, "br-if-not", 3, 0, 0)
{
- BR (scm_is_false_or_nil (*sp));
+ BR (scm_is_false (*sp));
}
VM_DEFINE_INSTRUCTION (38, br_if_eq, "br-if-eq", 3, 0, 0)
VM_DEFINE_INSTRUCTION (40, br_if_null, "br-if-null", 3, 0, 0)
{
- BR (scm_is_null_or_nil (*sp));
+ BR (scm_is_null (*sp));
}
VM_DEFINE_INSTRUCTION (41, br_if_not_null, "br-if-not-null", 3, 0, 0)
{
- BR (!scm_is_null_or_nil (*sp));
+ BR (!scm_is_null (*sp));
}
\f
SCM contregs;
POP (contregs);
+ SYNC_ALL ();
scm_i_check_continuation (contregs);
vm_return_to_continuation (scm_i_contregs_vm (contregs),
scm_i_contregs_vm_cont (contregs),
VM_DEFINE_INSTRUCTION (94, partial_cont_call, "partial-cont-call", 0, -1, 0)
{
- SCM vmcont, intwinds;
+ SCM vmcont, intwinds, prevwinds;
POP (intwinds);
POP (vmcont);
SYNC_REGISTER ();
{ finish_args = vmcont;
goto vm_error_continuation_not_rewindable;
}
- vm_reinstate_partial_continuation (vm, vmcont, intwinds, sp + 1 - fp, fp);
+ prevwinds = scm_i_dynwinds ();
+ vm_reinstate_partial_continuation (vm, vmcont, intwinds, sp + 1 - fp, fp,
+ vm_cookie);
+
+ /* Rewind prompt jmpbuffers, if any. */
+ {
+ SCM winds = scm_i_dynwinds ();
+ for (; !scm_is_eq (winds, prevwinds); winds = scm_cdr (winds))
+ if (SCM_PROMPT_P (scm_car (winds)) && SCM_PROMPT_SETJMP (scm_car (winds)))
+ break;
+ }
+
CACHE_REGISTER ();
program = SCM_FRAME_PROGRAM (fp);
CACHE_PROGRAM ();
SYNC_REGISTER ();
/* Push the prompt onto the dynamic stack. */
- prompt = scm_c_make_prompt (k, fp, sp, ip + offset, escape_only_p, vm_cookie);
- scm_i_set_dynwinds (scm_cons (prompt, scm_i_dynwinds ()));
+ prompt = scm_c_make_prompt (k, fp, sp, ip + offset, escape_only_p, vm_cookie,
+ scm_i_dynwinds ());
+ scm_i_set_dynwinds (scm_cons (prompt, SCM_PROMPT_DYNWINDS (prompt)));
if (SCM_PROMPT_SETJMP (prompt))
{
/* The prompt exited nonlocally. Cache the regs back from the vp, and go
if (sp - 2*n < SCM_FRAME_UPPER_ADDRESS (fp))
goto vm_error_stack_underflow;
+ SYNC_REGISTER ();
wf = scm_i_make_with_fluids (n, sp + 1 - 2*n, sp + 1 - n);
scm_i_swap_with_fluids (wf, dynstate);
scm_i_set_dynwinds (scm_cons (wf, scm_i_dynwinds ()));
NEXT;
}
+VM_DEFINE_INSTRUCTION (95, assert_nargs_ee_locals, "assert-nargs-ee/locals", 1, 0, 0)
+{
+ scm_t_ptrdiff n;
+ SCM *old_sp;
+
+ /* nargs = n & 0x7, nlocs = nargs + (n >> 3) */
+ n = FETCH ();
+
+ if (SCM_UNLIKELY (sp - (fp - 1) != (n & 0x7)))
+ goto vm_error_wrong_num_args;
+
+ old_sp = sp;
+ sp += (n >> 3);
+ CHECK_OVERFLOW ();
+ while (old_sp < sp)
+ *++old_sp = SCM_UNDEFINED;
+
+ NEXT;
+}
+
/*
(defun renumber-ops ()