mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-17 17:20:29 +02:00
add assert-nargs-ee/locals instruction
* libguile/vm-i-system.c (assert-nargs-ee/locals): New instruction, a combination of assert-nargs-ee and reserve-locals in the case in which nreq and nlocs can both be represented in 8 bits. * module/language/glil/compile-assembly.scm (glil->assembly): Add compiler case. * doc/ref/vm.texi (Function Prologue Instructions): Update docs.
This commit is contained in:
parent
384dce46bf
commit
de45d8eef9
3 changed files with 38 additions and 8 deletions
|
@ -1622,6 +1622,26 @@ VM_DEFINE_INSTRUCTION (93, fluid_set, "fluid-set", 0, 2, 0)
|
|||
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 ()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue