diff options
author | Andy Wingo <wingo@pobox.com> | 2017-10-30 10:39:37 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2017-10-30 12:06:07 +0100 |
commit | c92b80be2d60f9189ac4f7ee53b9386d34921dd4 (patch) | |
tree | 4af8b5e1f8028375704aceb86db3c370f799148d /libguile/vm-engine.c | |
parent | 7aff0fff22c6d70b5ad93b387840f555c160464f (diff) | |
download | guile-c92b80be2d60f9189ac4f7ee53b9386d34921dd4.tar.gz |
Emit new instructions in function preludes
* module/system/vm/assembler.scm (standard-prelude, opt-prelude):
(kw-prelude): Emit new instructions in function preludes. Now all
branches are via the new instructions. Remove exports for old
branches.
Diffstat (limited to 'libguile/vm-engine.c')
-rw-r--r-- | libguile/vm-engine.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c index e49268805..97472db66 100644 --- a/libguile/vm-engine.c +++ b/libguile/vm-engine.c @@ -4189,30 +4189,23 @@ VM_NAME (scm_i_thread *thread, struct scm_vm *vp, { scm_t_uint8 compare_result; scm_t_uint32 nreq, expected; - scm_t_ptrdiff nargs; + scm_t_ptrdiff nargs, npos; UNPACK_24 (op, nreq); UNPACK_24 (ip[1], expected); nargs = FRAME_LOCALS_COUNT (); - /* We can only have too many positionals if there are more - arguments than NPOS. */ - if (nargs < (scm_t_ptrdiff) nreq) + /* Precondition: at least NREQ arguments. */ + for (npos = nreq; npos < nargs && npos <= expected; npos++) + if (scm_is_keyword (FP_REF (npos))) + break; + + if (npos < (scm_t_ptrdiff) expected) compare_result = SCM_F_COMPARE_LESS_THAN; + else if (npos == (scm_t_ptrdiff) expected) + compare_result = SCM_F_COMPARE_EQUAL; else - { - scm_t_ptrdiff npos = nreq; - for (npos = nreq; npos < nargs && npos <= expected; npos++) - if (scm_is_keyword (FP_REF (npos))) - break; - - if (npos < (scm_t_ptrdiff) expected) - compare_result = SCM_F_COMPARE_LESS_THAN; - else if (npos == (scm_t_ptrdiff) expected) - compare_result = SCM_F_COMPARE_EQUAL; - else - compare_result = SCM_F_COMPARE_NONE; - } + compare_result = SCM_F_COMPARE_NONE; vp->compare_result = compare_result; |