guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] 04/06: Remove duplicate procedure in slot-allocation.scm


From: Ludovic Courtès
Subject: [Guile-commits] 04/06: Remove duplicate procedure in slot-allocation.scm.
Date: Wed, 12 Feb 2020 05:43:30 -0500 (EST)

civodul pushed a commit to branch stable-2.2
in repository guile.

commit f4b0c3a93f1c12da8a6f0f7d37099956e2667946
Author: Ludovic Courtès <address@hidden>
AuthorDate: Sat Feb 8 11:28:59 2020 +0100

    Remove duplicate procedure in slot-allocation.scm.
    
    * module/language/cps/slot-allocation.scm (add-live-slot)
    (kill-dead-slot, compute-slot): Move higher up in the file.
    (compute-shuffles): Remove duplicate 'add-live-slot' procedure.
---
 module/language/cps/slot-allocation.scm | 27 ++++++++++++---------------
 1 file changed, 12 insertions(+), 15 deletions(-)

diff --git a/module/language/cps/slot-allocation.scm 
b/module/language/cps/slot-allocation.scm
index 2d95f42..f623aac 100644
--- a/module/language/cps/slot-allocation.scm
+++ b/module/language/cps/slot-allocation.scm
@@ -1,6 +1,6 @@
 ;; Continuation-passing style (CPS) intermediate language (IL)
 
-;; Copyright (C) 2013, 2014, 2015 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
 
 ;;;; This library is free software; you can redistribute it and/or
 ;;;; modify it under the terms of the GNU Lesser General Public
@@ -551,10 +551,18 @@ are comparable with eqv?.  A tmp slot may be used."
                             tmp)
                       (loop to-move b (cons s+d moved) last-source))))))))))
 
-(define (compute-shuffles cps slots call-allocs live-in)
-  (define (add-live-slot slot live-slots)
-    (logior live-slots (ash 1 slot)))
+(define-inlinable (add-live-slot slot live-slots)
+  (logior live-slots (ash 1 slot)))
+
+(define-inlinable (kill-dead-slot slot live-slots)
+  (logand live-slots (lognot (ash 1 slot))))
 
+(define-inlinable (compute-slot live-slots hint)
+  (if (and hint (not (logbit? hint live-slots)))
+      hint
+      (find-first-zero live-slots)))
+
+(define (compute-shuffles cps slots call-allocs live-in)
   (define (get-cont label)
     (intmap-ref cps label))
 
@@ -728,17 +736,6 @@ are comparable with eqv?.  A tmp slot may be used."
                    (_ slots)))
                cps empty-intmap))
 
-(define-inlinable (add-live-slot slot live-slots)
-  (logior live-slots (ash 1 slot)))
-
-(define-inlinable (kill-dead-slot slot live-slots)
-  (logand live-slots (lognot (ash 1 slot))))
-
-(define-inlinable (compute-slot live-slots hint)
-  (if (and hint (not (logbit? hint live-slots)))
-      hint
-      (find-first-zero live-slots)))
-
 (define (allocate-lazy-vars cps slots call-allocs live-in lazy)
   (define (compute-live-slots slots label)
     (intset-fold (lambda (var live)



reply via email to

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