1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-23 20:05:32 +02:00

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.
This commit is contained in:
Andy Wingo 2009-12-13 17:05:10 +01:00
parent 4abb824cdb
commit 9331f91cc4
3 changed files with 55 additions and 16 deletions

View file

@ -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));