[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.2-141-g21524
From: |
Ludovic Courtès |
Subject: |
[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.2-141-g2152443 |
Date: |
Fri, 30 Sep 2011 13:20:42 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".
http://git.savannah.gnu.org/cgit/guile.git/commit/?id=21524430e9d821014d6c0efbe4df74c12179c072
The branch, stable-2.0 has been updated
via 21524430e9d821014d6c0efbe4df74c12179c072 (commit)
via 9acea53ecd4377a98250f52517ed0f00a108f103 (commit)
via 16d50b8e89d92f7aacea374802cb47c5ee373a33 (commit)
from 014de9e25d87b7d3a13566aee4c271c1a11ea0b7 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 21524430e9d821014d6c0efbe4df74c12179c072
Author: Ludovic Courtès <address@hidden>
Date: Fri Sep 30 15:20:16 2011 +0200
peval: Add test for possible infinite recursion.
* test-suite/tests/tree-il.test ("partial evaluation"): Add test.
commit 9acea53ecd4377a98250f52517ed0f00a108f103
Author: Ludovic Courtès <address@hidden>
Date: Fri Sep 30 15:16:02 2011 +0200
Add link to the (ice-9 match) bug.
* module/ice-9/match.scm: Add comment.
commit 16d50b8e89d92f7aacea374802cb47c5ee373a33
Author: Ludovic Courtès <address@hidden>
Date: Fri Sep 23 17:27:28 2011 +0200
peval: Recognize module-refs to primitives.
* module/language/tree-il/optimize.scm (peval): Handle module-refs to
primitives.
* test-suite/tests/tree-il.test ("partial evaluation"): Add test, using
`pmatch'.
-----------------------------------------------------------------------
Summary of changes:
module/ice-9/match.scm | 1 +
module/language/tree-il/peval.scm | 9 +++++++++
test-suite/tests/tree-il.test | 22 ++++++++++++++++++++++
3 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/module/ice-9/match.scm b/module/ice-9/match.scm
index 0384f69..2753ebe 100644
--- a/module/ice-9/match.scm
+++ b/module/ice-9/match.scm
@@ -58,6 +58,7 @@
;; file.
(include-from-path "ice-9/match.upstream.scm")
+;; Patch to work around <http://debbugs.gnu.org/9567>.
(define-syntax match
(syntax-rules ()
((match)
diff --git a/module/language/tree-il/peval.scm
b/module/language/tree-il/peval.scm
index a097dd4..c05a2be 100644
--- a/module/language/tree-il/peval.scm
+++ b/module/language/tree-il/peval.scm
@@ -708,6 +708,15 @@ it does not handle <fix> and <let-values>, it should be
called before
(($ <toplevel-ref>)
;; todo: open private local bindings.
exp)
+ (($ <module-ref> src module (? effect-free-primitive? name) #f)
+ (let ((module (false-if-exception
+ (resolve-module module #:ensure #f))))
+ (if (module? module)
+ (let ((var (module-variable module name)))
+ (if (eq? var (module-variable the-scm-module name))
+ (make-primitive-ref src name)
+ exp))
+ exp)))
(($ <module-ref>)
exp)
(($ <module-set> src mod name public? exp)
diff --git a/test-suite/tests/tree-il.test b/test-suite/tests/tree-il.test
index 1a11d35..32e2a28 100644
--- a/test-suite/tests/tree-il.test
+++ b/test-suite/tests/tree-il.test
@@ -762,6 +762,19 @@
(const 10))
(pass-if-peval
+ ;; Primitives in module-refs are resolved (the expansion of `pmatch'
+ ;; below leads to calls to (@@ (system base pmatch) car) and
+ ;; similar, which is what we want to be inlined.)
+ (begin
+ (use-modules (system base pmatch))
+ (pmatch '(a b c d)
+ ((a b . _)
+ #t)))
+ (begin
+ (apply . _)
+ (const #t)))
+
+ (pass-if-peval
;; Mutability preserved.
((lambda (x y z) (list x y z)) 1 2 3)
(apply (primitive list) (const 1) (const 2) (const 3)))
@@ -1220,6 +1233,15 @@
(letrec _ . _))
(pass-if-peval
+ ;; Infinite recursion: all the arguments to `loop' are static, but
+ ;; unrolling it would lead `peval' to enter an infinite loop.
+ (let loop ((x 0))
+ (and (< x top)
+ (loop (1+ x))))
+ (letrec (loop) (_) ((lambda . _))
+ (apply (lexical loop _) (const 0))))
+
+ (pass-if-peval
;; Constant folding: cons
(begin (cons 1 2) #f)
(const #f))
hooks/post-receive
--
GNU Guile
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.2-141-g2152443,
Ludovic Courtès <=