From 9331f91cc411fc2a09a59308bb889f3f5f735e49 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Sun, 13 Dec 2009 17:05:10 +0100 Subject: primitive-eval passes first N args on stack directly, not via apply * libguile/memoize.c (MAKMEMO_CALL): Memoize in the number of arguments at the call site. (memoize, scm_m_cond, memoize_named_let, unmemoize): * libguile/eval.c (eval): Adapt to changes in call memoization. * module/ice-9/eval.scm (primitive-eval): For calls, pass the first N arguments directly on the stack, and only the rest as a consed argument list to apply. Currently N is 4. --- libguile/eval.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libguile/eval.c') diff --git a/libguile/eval.c b/libguile/eval.c index ec19c2345..0bd54a0ef 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -254,8 +254,8 @@ eval (SCM x, SCM env) case SCM_M_CALL: /* Evaluate the procedure to be applied. */ proc = eval (CAR (mx), env); - - mx = CDR (mx); + /* int nargs = CADR (mx); */ + mx = CDDR (mx); if (BOOT_CLOSURE_P (proc)) { @@ -289,6 +289,7 @@ eval (SCM x, SCM env) else { SCM rest = SCM_EOL; + /* FIXME: use alloca */ for (; scm_is_pair (mx); mx = CDR (mx)) rest = scm_cons (eval (CAR (mx), env), rest); return scm_vm_apply (scm_the_vm (), proc, scm_reverse (rest)); -- cgit v1.2.3