diff options
author | Andy Wingo <wingo@pobox.com> | 2010-05-02 13:41:31 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2010-05-02 13:41:31 +0200 |
commit | de45d8eef9dc16c3020219886a7e5fd11a553fbb (patch) | |
tree | ff4ca780b8a7c5dcc955e988ce45287b09c4082c /libguile/vm-i-system.c | |
parent | 384dce46bf2313f9c429984b4e7cefe9d14fbcee (diff) | |
download | guile-de45d8eef9dc16c3020219886a7e5fd11a553fbb.tar.gz |
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.
Diffstat (limited to 'libguile/vm-i-system.c')
-rw-r--r-- | libguile/vm-i-system.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libguile/vm-i-system.c b/libguile/vm-i-system.c index c1d949139..cedd43fd5 100644 --- a/libguile/vm-i-system.c +++ b/libguile/vm-i-system.c @@ -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 () |