guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.2-83-g3f2d6e


From: Ludovic Courtès
Subject: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.2-83-g3f2d6ef
Date: Tue, 13 Sep 2011 21:35:07 +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=3f2d6efc7b61999a4522b1c35d6f4a875a2c74c0

The branch, stable-2.0 has been updated
       via  3f2d6efc7b61999a4522b1c35d6f4a875a2c74c0 (commit)
       via  af1c6e424ffb7f37391fc62d788591adc40381e1 (commit)
      from  735249513a0a2966f6570ee32cd2988b3bc6524d (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 3f2d6efc7b61999a4522b1c35d6f4a875a2c74c0
Author: Ludovic Courtès <address@hidden>
Date:   Tue Sep 13 23:34:07 2011 +0200

    peval: Use `resolve-primitives!'.
    
    * module/language/tree-il/optimize.scm (peval): Add `cenv' optional
      argument; caller updated.
      Use `resolve-primitives!' to resolve <primitive-ref> expressions.

commit af1c6e424ffb7f37391fc62d788591adc40381e1
Author: Ludovic Courtès <address@hidden>
Date:   Tue Sep 13 23:30:22 2011 +0200

    peval: Clarify `pure-expression?'.
    
    * module/language/tree-il/optimize.scm (peval)[pure-expression?]:
      Clarify the comment.

-----------------------------------------------------------------------

Summary of changes:
 module/language/tree-il/optimize.scm |   29 ++++++++++++++---------------
 1 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/module/language/tree-il/optimize.scm 
b/module/language/tree-il/optimize.scm
index 5525784..86f1f2f 100644
--- a/module/language/tree-il/optimize.scm
+++ b/module/language/tree-il/optimize.scm
@@ -34,18 +34,18 @@
   (let ((peval (match (memq #:partial-eval? opts)
                  ((#:partial-eval? #f _ ...)
                   ;; Disable partial evaluation.
-                  identity)
+                  (lambda (x e) x))
                  (_ peval))))
    (inline!
     (fix-letrec!
-     (peval
-      (expand-primitives!
-       (resolve-primitives! x env)))))))
+     (peval (expand-primitives! (resolve-primitives! x env))
+            env)))))
 
-(define* (peval exp #:optional (env vlist-null))
-  "Partially evaluate EXP in top-level environment ENV and return the
-resulting expression.  Since it does not handle <fix> and <let-values>,
-it should be called before `fix-letrec'."
+(define* (peval exp #:optional (cenv (current-module)) (env vlist-null))
+  "Partially evaluate EXP in compilation environment CENV, with
+top-level bindings from ENV and return the resulting expression.  Since
+it does not handle <fix> and <let-values>, it should be called before
+`fix-letrec'."
 
   ;; This is a simple partial evaluator.  It effectively performs
   ;; constant folding, copy propagation, dead code elimination, and
@@ -99,8 +99,9 @@ it should be called before `fix-letrec'."
 
   (define (pure-expression? x)
     ;; Return true if X is pure---i.e., if it is known to have no
-    ;; effects and does not allocate new storage.  Note: <module-ref> is
-    ;; not "pure" because it loads a module as a side-effect.
+    ;; effects and does not allocate storage for a mutable object.
+    ;; Note: <module-ref> is not "pure" because it loads a module as a
+    ;; side-effect.
     (let loop ((x x))
       (match x
         (($ <void>) #t)
@@ -236,11 +237,9 @@ it should be called before `fix-letrec'."
                  body
                  (make-letrec src in-order? names gensyms vals body))))
           (($ <toplevel-ref> src (? effect-free-primitive? name))
-           (if (and (not (local-toplevel? name))
-                    (eq? (module-ref (current-module) name #f)
-                         (module-ref the-scm-module name)))
-               (make-primitive-ref src name)
-               exp))
+           (if (local-toplevel? name)
+               exp
+               (resolve-primitives! exp cenv)))
           (($ <toplevel-ref>)
            ;; todo: open private local bindings.
            exp)


hooks/post-receive
-- 
GNU Guile



reply via email to

[Prev in Thread] Current Thread [Next in Thread]