summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2011-09-21 08:46:44 +0200
committerAndy Wingo <wingo@pobox.com>2011-09-21 08:58:27 +0200
commit2605b6ba2749a90c55a7f49bb91d6f20f256a20e (patch)
treeada9c670eab87a24fe4c14b98b2d8e88b08c64ff
parentddbee5c00f438c4dc1dbe2b944b559a3c2de0e6b (diff)
downloadguile-2605b6ba2749a90c55a7f49bb91d6f20f256a20e.tar.gz
better pure-expression?
* module/language/tree-il/optimize.scm (peval): Allow dynref, fix, and let-values to be pure expressions.
-rw-r--r--module/language/tree-il/optimize.scm5
1 files changed, 5 insertions, 0 deletions
diff --git a/module/language/tree-il/optimize.scm b/module/language/tree-il/optimize.scm
index 0567b0cfa..f69ce557e 100644
--- a/module/language/tree-il/optimize.scm
+++ b/module/language/tree-il/optimize.scm
@@ -320,6 +320,7 @@ it does not handle <fix> and <let-values>, it should be called before
(($ <lexical-ref>) #t)
(($ <toplevel-ref>) #t)
(($ <primitive-ref>) #t)
+ (($ <dynref> _ fluid) (loop fluid))
(($ <conditional> _ condition subsequent alternate)
(and (loop condition) (loop subsequent) (loop alternate)))
(($ <application> _ ($ <primitive-ref> _ name) args)
@@ -334,6 +335,10 @@ it does not handle <fix> and <let-values>, it should be called before
(and (every loop vals) (loop body)))
(($ <letrec> _ _ _ _ vals body)
(and (every loop vals) (loop body)))
+ (($ <fix> _ _ _ vals body)
+ (and (every loop vals) (loop body)))
+ (($ <let-values> _ exp body)
+ (and (loop exp) (loop body)))
(_ #f))))
(define (mutable? exp)