summaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2011-09-13 14:31:18 +0200
committerLudovic Courtès <ludo@gnu.org>2011-09-13 16:00:24 +0200
commit1e8ace33d17a3156c184e8121eb291a7c9324ccc (patch)
tree21bf850ea99473a8d3ea2a33602d713f4ab52880 /module
parent870dfc609b0bf090d38878d7224e65843c355485 (diff)
downloadguile-1e8ace33d17a3156c184e8121eb291a7c9324ccc.tar.gz
peval: Add tests for inlining with both static & dynamic arguments.
* module/language/tree-il/optimize.scm (peval): Improve comment on the inlining heuristics. * test-suite/tests/tree-il.test ("partial evaluation"): Add two tests.
Diffstat (limited to 'module')
-rw-r--r--module/language/tree-il/optimize.scm7
1 files changed, 4 insertions, 3 deletions
diff --git a/module/language/tree-il/optimize.scm b/module/language/tree-il/optimize.scm
index 15b8ec0c3..4453df3a3 100644
--- a/module/language/tree-il/optimize.scm
+++ b/module/language/tree-il/optimize.scm
@@ -251,9 +251,10 @@ it should be called before `fix-letrec'."
(args (map (cut loop <> env calls) orig-args))
(args* (map maybe-unconst orig-args args))
(app (make-application src proc args*)))
- ;; If ARGS are constants and this call hasn't already been
- ;; expanded before (to avoid infinite recursion), then
- ;; expand it (todo: emit an infinite recursion warning.)
+ ;; If at least one of ARGS is static (to avoid infinite
+ ;; inlining) and this call hasn't already been expanded
+ ;; before (to avoid infinite recursion), then expand it
+ ;; (todo: emit an infinite recursion warning.)
(if (and (any const*? args)
(not (member (cons proc args) calls)))
(match proc