diff options
author | Andy Wingo <wingo@pobox.com> | 2013-10-27 09:52:39 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2013-10-27 09:52:39 +0100 |
commit | 0720f70ed7e9de2685409abfe4e2c0dd01f81b74 (patch) | |
tree | 695650decf699cbb5b544fd9dec881adcfe56e47 /libguile/eval.c | |
parent | c450b47723438ad9e517b02a45b577b7f7fd848b (diff) | |
download | guile-0720f70ed7e9de2685409abfe4e2c0dd01f81b74.tar.gz |
Memoized expressions are pairs, not SMOBs
* libguile/memoize.c (MAKMEMO): Memoized objects are pairs now, not
SMOBs. This lets eval.scm destructure them more efficiently.
(scm_print_memoized, scm_memoized_p, scm_memoized_expression_typecode)
(scm_memoized_expression_data): Remove these interfaces.
(unmemoize, scm_memoize_variable_access_x): Remove SMOB type checks.
(scm_init_memoize): Remove SMOB type definition.
* libguile/memoize.h (scm_tc16_memoized, SCM_MEMOIZED_P)
(scm_memoized_expression_typecode, scm_memoized_expression_data)
(scm_memoized_p): Remove declarations.
* libguile/validate.h (SCM_VALIDATE_MEMOIZED): Remove declaration.
* libguile/eval.c (eval): Remove memoized type check, and inline the
inum unpacking.
* module/ice-9/eval.scm (memoized-expression-case): Use car and cdr to
destructure memoized expressions. A big win!
Diffstat (limited to 'libguile/eval.c')
-rw-r--r-- | libguile/eval.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/libguile/eval.c b/libguile/eval.c index 36199a60b..43a182a5a 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -266,11 +266,9 @@ eval (SCM x, SCM env) loop: SCM_TICK; - if (!SCM_MEMOIZED_P (x)) - abort (); mx = SCM_MEMOIZED_ARGS (x); - switch (SCM_MEMOIZED_TAG (x)) + switch (SCM_I_INUM (SCM_CAR (x))) { case SCM_M_SEQ: eval (CAR (mx), env); |