summaryrefslogtreecommitdiff
path: root/libguile/eval.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2009-12-13 17:05:10 +0100
committerAndy Wingo <wingo@pobox.com>2009-12-13 17:19:59 +0100
commit9331f91cc411fc2a09a59308bb889f3f5f735e49 (patch)
treefe3bf6d8a0590c7118aaaa99de51eb7c61d014b8 /libguile/eval.c
parent4abb824cdbd5f16a836da8ab75cc24a6a53f3b35 (diff)
downloadguile-9331f91cc411fc2a09a59308bb889f3f5f735e49.tar.gz
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.
Diffstat (limited to 'libguile/eval.c')
-rw-r--r--libguile/eval.c5
1 files changed, 3 insertions, 2 deletions
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));