Eliminate "base/btree" and "base/hashtb" files. Rewrite code to use
authorChris Hanson <org/chris-hanson/cph>
Tue, 12 Oct 1993 07:30:29 +0000 (07:30 +0000)
committerChris Hanson <org/chris-hanson/cph>
Tue, 12 Oct 1993 07:30:29 +0000 (07:30 +0000)
runtime system's rb-tree and hash-table abstractions.

26 files changed:
v7/src/compiler/back/symtab.scm
v7/src/compiler/base/infnew.scm
v7/src/compiler/base/make.scm
v7/src/compiler/machines/C/compiler.cbf
v7/src/compiler/machines/C/compiler.pkg
v7/src/compiler/machines/C/decls.scm
v7/src/compiler/machines/alpha/compiler.cbf
v7/src/compiler/machines/alpha/compiler.pkg
v7/src/compiler/machines/alpha/decls.scm
v7/src/compiler/machines/bobcat/compiler.cbf
v7/src/compiler/machines/bobcat/compiler.pkg
v7/src/compiler/machines/bobcat/decls.scm
v7/src/compiler/machines/i386/compiler.cbf
v7/src/compiler/machines/i386/compiler.pkg
v7/src/compiler/machines/i386/decls.scm
v7/src/compiler/machines/mips/compiler.cbf
v7/src/compiler/machines/mips/compiler.pkg
v7/src/compiler/machines/mips/decls.scm
v7/src/compiler/machines/sparc/decls.scm
v7/src/compiler/machines/spectrum/compiler.cbf
v7/src/compiler/machines/spectrum/compiler.pkg
v7/src/compiler/machines/spectrum/decls.scm
v7/src/compiler/machines/vax/compiler.cbf
v7/src/compiler/machines/vax/compiler.pkg
v7/src/compiler/machines/vax/decls.scm
v7/src/compiler/rtlbase/rtlobj.scm

index 296b9df33a56b3c22b5d68098df732b5f4b155c7..3ca890b50394b6f4a04b51a0772fb42b90e93d35 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/back/symtab.scm,v 1.44 1990/05/03 14:59:34 jinx Rel $
+$Id: symtab.scm,v 1.45 1993/10/12 07:27:12 cph Exp $
 
-Copyright (c) 1987, 1990 Massachusetts Institute of Technology
+Copyright (c) 1987-93 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -38,24 +38,24 @@ MIT in each case. |#
 (declare (usual-integrations))
 \f
 (define (make-symbol-table)
-  (symbol-hash-table/make 1009))
+  (make-eq-hash-table))
 
 (define (symbol-table-define! table key value)
-  (symbol-hash-table/modify! table key
-    (lambda (binding)
-      (error "symbol-table-define!: Redefining" key)
-      (set-binding-value! binding value)
-      binding)
-    (lambda ()
-      (make-binding value))))
+  (let ((binding (hash-table/get table key #f)))
+    (if binding
+       (begin
+         (error "Redefining symbol:" key)
+         (set-binding-value! binding value))
+       (hash-table/put! table key (make-binding value)))))
 
 (define (symbol-table-value table key)
-  (symbol-hash-table/lookup* table key
-    (lambda (binding)
-      (or (binding-value binding)
-         (error "SYMBOL-TABLE-VALUE: no value" key)))
-    (lambda ()
-      (error "SYMBOL-TABLE-VALUE: Undefined key" key))))
+  (let ((binding (hash-table/get table key #f)))
+    (if (not binding)
+       (error "Undefined key:" key))
+    (let ((value (binding-value binding)))
+      (if (not value)
+         (error "Key has no value:" key))
+      value)))
 
 (define (symbol-table->assq-list table)
   (map (lambda (pair)
@@ -63,7 +63,7 @@ MIT in each case. |#
        (symbol-table-bindings table)))
 
 (define-integrable (symbol-table-bindings table)
-  (symbol-hash-table/bindings table))
+  (hash-table->alist table))
 
 (define-integrable (make-binding initial-value)
   (cons initial-value '()))
@@ -72,4 +72,4 @@ MIT in each case. |#
   (car binding))
 
 (define (set-binding-value! binding value)
-  (set-car! binding value))
+  (set-car! binding value))
\ No newline at end of file
index 854cd2c42341c8351e7ec031a7e3ce6beecf103c..2b4583d316fdd398ba4f65d615acfac60b74dc94 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Id: infnew.scm,v 4.9 1992/12/29 19:51:57 gjr Exp $
+$Id: infnew.scm,v 4.10 1993/10/12 07:27:38 cph Exp $
 
-Copyright (c) 1988-1992 Massachusetts Institute of Technology
+Copyright (c) 1988-93 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -262,33 +262,30 @@ MIT in each case. |#
 
 (define (info-generation-phase-3 expression procedures continuations
                                 label-bindings external-labels)
-  (let ((label-bindings (labels->dbg-labels label-bindings)))
-    (let ((labels (make-btree)))
+  (let ((label-bindings (labels->dbg-labels label-bindings))
+       (no-datum '(NO-DATUM)))
+    (let ((labels (make-string-hash-table)))
       (for-each (lambda (label-binding)
-                 (for-each (lambda (name)
-                             (btree-insert! labels string<? car name
-                               (lambda (name)
-                                 (cons name (cdr label-binding)))
-                               (lambda (association)
-                                 (error "redefining label" association))
-                               (lambda (association)
-                                 association
-                                 unspecific)))
+                 (for-each (lambda (key)
+                             (let ((datum
+                                    (hash-table/get labels key no-datum)))
+                               (if (not (eq? datum no-datum))
+                                   (error "Redefining label:" key datum)))
+                             (hash-table/put! labels
+                                              key
+                                              (cdr label-binding)))
                            (car label-binding)))
                label-bindings)
       (let ((map-label/fail
             (lambda (label)
-              (btree-lookup labels string<? car (system-pair-car label)
-                cdr
-                (lambda (name)
-                  (error "Missing label" name)))))
+              (let ((key (system-pair-car label)))
+                (let ((datum (hash-table/get labels key no-datum)))
+                  (if (eq? datum no-datum)
+                      (error "Missing label:" key))
+                  datum))))
            (map-label/false
             (lambda (label)
-              (btree-lookup labels string<? car (system-pair-car label)
-                cdr
-                (lambda (name)
-                  name                 ; ignored
-                  false)))))
+              (hash-table/get labels (system-pair-car label) #f))))
        (for-each (lambda (label)
                    (set-dbg-label/external?! (map-label/fail label) true))
                  external-labels)
@@ -303,8 +300,9 @@ MIT in each case. |#
             (set-dbg-procedure/label! procedure mapped-label)
             (cond ((dbg-procedure/external-label procedure)
                    => (lambda (label)
-                        (set-dbg-procedure/external-label! procedure                    
-                                                           (map-label/fail label))))
+                        (set-dbg-procedure/external-label!
+                         procedure
+                         (map-label/fail label))))
                   ((not mapped-label)
                    (error "Missing label" internal-label)))))
         procedures)
@@ -326,20 +324,16 @@ MIT in each case. |#
           (cons names
                 (make-dbg-label-2 (choose-distinguished-label names)
                                   (car offset-binding)))))
-       (let ((offsets (make-btree)))
+       (let ((offsets (make-rb-tree = <)))
         (for-each (lambda (binding)
-                    (let ((name (system-pair-car (car binding))))
-                      (btree-insert! offsets < car (cdr binding)
-                        (lambda (offset)
-                          (list offset name))
-                        (lambda (offset-binding)
-                          (set-cdr! offset-binding
-                                    (cons name (cdr offset-binding))))
-                        (lambda (offset-binding)
-                          offset-binding
-                          unspecific))))
+                    (let ((offset (cdr binding))
+                          (name (system-pair-car (car binding))))
+                      (let ((datum (rb-tree/lookup offsets offset #f)))
+                        (if datum
+                            (set-cdr! datum (cons name (cdr datum)))
+                            (rb-tree/insert! offsets offset (list name))))))
                   label-bindings)
-        (btree-fringe offsets))))
+        (rb-tree->alist offsets))))
 
 (define (choose-distinguished-label names)
   (if (null? (cdr names))
index f9b14f4682c5792f0bffab6b7d830f0ef4c484be..7ea1526ac594afed401beb3f36fbc9ac2cca7e02 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: make.scm,v 4.99 1993/07/01 03:11:07 gjr Exp $
+$Id: make.scm,v 4.100 1993/10/12 07:27:58 cph Exp $
 
 Copyright (c) 1988-1993 Massachusetts Institute of Technology
 
@@ -37,6 +37,8 @@ MIT in each case. |#
 (declare (usual-integrations))
 
 (lambda (architecture-name)
+  (load-option 'HASH-TABLE)
+  (load-option 'RB-TREE)
   (package/system-loader "comp" '() 'QUERY)
   (let ((initialize-package!
         (lambda (package-name)
@@ -46,5 +48,5 @@ MIT in each case. |#
     (initialize-package! '(COMPILER DECLARATIONS)))
   (add-system!
    (make-system (string-append "Liar (" architecture-name ")")
-               4 99
+               4 100
                '())))
\ No newline at end of file
index a8323eae214bbe9087346e4b20b6246cbf98dd0c..60297095f271522132122aa41babfd5bbcd26e10 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Id: compiler.cbf,v 1.1 1993/06/08 06:13:32 gjr Exp $
+$Id: compiler.cbf,v 1.2 1993/10/12 07:28:43 cph Exp $
 
-Copyright (c) 1992 Massachusetts Institute of Technology
+Copyright (c) 1992-93 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -34,12 +34,13 @@ MIT in each case. |#
 
 ;;;; Script to incrementally compile the compiler (from .bins)
 
-(for-each compile-directory
-         '("back"
-           "base"
-           "fggen"
-           "fgopt"
-           "machines/C"
-           "rtlbase"
-           "rtlgen"
-           "rtlopt"))
\ No newline at end of file
+(fluid-let ((compiler:coalescing-constant-warnings? #f))
+  (for-each compile-directory
+           '("back"
+             "base"
+             "fggen"
+             "fgopt"
+             "machines/C"
+             "rtlbase"
+             "rtlgen"
+             "rtlopt")))
\ No newline at end of file
index ba78f1f14972789e133d49a30a859ca3e652c3c3..0fdd1c3af05badd84d4e132ad223018eb4632f09 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: compiler.pkg,v 1.3 1993/08/26 06:29:30 gjr Exp $
+$Id: compiler.pkg,v 1.4 1993/10/12 07:28:44 cph Exp $
 
 Copyright (c) 1992-1993 Massachusetts Institute of Technology
 
@@ -38,7 +38,6 @@ MIT in each case. |#
 
 (define-package (compiler)
   (files "base/switch"
-        "base/hashtb"
         "base/object"                  ;tagged object support
         "base/enumer"                  ;enumerations
         "base/sets"                    ;set abstraction
@@ -120,16 +119,6 @@ MIT in each case. |#
          reference-context?
          set-reference-context/offset!))
 
-(define-package (compiler balanced-binary-tree)
-  (files "base/btree")
-  (parent (compiler))
-  (export (compiler)
-         btree-delete!
-         btree-fringe
-         btree-insert!
-         btree-lookup
-         make-btree))
-
 (define-package (compiler macros)
   (files "base/macros")
   (parent ())
index 520b3f557ac7cb86ea0eb30cde23309d8b85f746..63d89db03c18eb31c6442162f5bf129d489a457b 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Id: decls.scm,v 1.1 1993/06/08 06:13:32 gjr Exp $
+$Id: decls.scm,v 1.2 1993/10/12 07:28:45 cph Exp $
 
-Copyright (c) 1992 Massachusetts Institute of Technology
+Copyright (c) 1992-93 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -69,19 +69,13 @@ MIT in each case. |#
     (if (null? filenames)
        (error "Can't find source files of compiler"))
     (set! source-filenames filenames))
-  (set! source-hash
-       (make/hash-table
-        101
-        string-hash-mod
-        (lambda (filename source-node)
-          (string=? filename (source-node/filename source-node)))
-        make/source-node))
+  (set! source-hash (make-string-hash-table))
   (set! source-nodes
        (map (lambda (filename)
-              (hash-table/intern! source-hash
-                                  filename
-                                  identity-procedure
-                                  identity-procedure))
+              (if (not (hash-table/get source-hash filename #f))
+                  (hash-table/put! source-hash
+                                   filename
+                                   (make/source-node filename))))
             source-filenames))
   (initialize/syntax-dependencies!)
   (initialize/integration-dependencies!)
@@ -114,10 +108,10 @@ MIT in each case. |#
   (modification-time false))
 
 (define (filename->source-node filename)
-  (hash-table/lookup source-hash
-                    filename
-                    identity-procedure
-                    (lambda () (error "Unknown source file" filename))))
+  (let ((node (hash-table/get source-hash filename #f)))
+    (if (not node)
+       (error "Unknown source file:" filename))
+    node))
 
 (define (source-node/circular? node)
   (memq node (source-node/backward-closure node)))
index 51a9b322ea747a5a8c9428cb5a56a6f1b35dec9a..e2190530814004aa6c4502a0e2a25bdb94acbd89 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Id: compiler.cbf,v 1.1 1992/08/29 13:51:17 jinx Exp $
+$Id: compiler.cbf,v 1.2 1993/10/12 07:29:15 cph Exp $
 
-Copyright (c) 1992 Digital Equipment Corporation (D.E.C.)
+Copyright (c) 1992-93 Digital Equipment Corporation (D.E.C.)
 
 This software was developed at the Digital Equipment Corporation
 Cambridge Research Laboratory.  Permission to copy this software, to
@@ -36,12 +36,13 @@ case.
 
 ;;;; Script to incrementally compile the compiler (from .bins)
 
-(for-each compile-directory
-         '("back"
-           "base"
-           "fggen"
-           "fgopt"
-           "machines/alpha"
-           "rtlbase"
-           "rtlgen"
-           "rtlopt"))
\ No newline at end of file
+(fluid-let ((compiler:coalescing-constant-warnings? #f))
+  (for-each compile-directory
+           '("back"
+             "base"
+             "fggen"
+             "fgopt"
+             "machines/alpha"
+             "rtlbase"
+             "rtlgen"
+             "rtlopt")))
\ No newline at end of file
index d89128fc7f3991b2ff17127c9b38a4e45a6ffb2d..87161bd9fe79f6ee68af8c1d715a775b6ac9da43 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: compiler.pkg,v 1.8 1993/08/26 06:33:56 gjr Exp $
+$Id: compiler.pkg,v 1.9 1993/10/12 07:29:15 cph Exp $
 
 Copyright (c) 1992-1993 Digital Equipment Corporation (D.E.C.)
 
@@ -40,7 +40,6 @@ case.
 
 (define-package (compiler)
   (files "base/switch"
-        "base/hashtb"
         "base/object"                  ;tagged object support
         "base/enumer"                  ;enumerations
         "base/sets"                    ;set abstraction
@@ -121,16 +120,6 @@ case.
          reference-context?
          set-reference-context/offset!))
 
-(define-package (compiler balanced-binary-tree)
-  (files "base/btree")
-  (parent (compiler))
-  (export (compiler)
-         btree-delete!
-         btree-fringe
-         btree-insert!
-         btree-lookup
-         make-btree))
-
 (define-package (compiler macros)
   (files "base/macros")
   (parent ())
index d7ab987a44255755ea828d7abfe638494209565c..d8d03a4b0591256714b88ffcb3ccaa8cfb097500 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Id: decls.scm,v 1.3 1992/11/18 03:53:38 gjr Exp $
+$Id: decls.scm,v 1.4 1993/10/12 07:29:16 cph Exp $
 
-Copyright (c) 1992 Digital Equipment Corporation (D.E.C.)
+Copyright (c) 1992-93 Digital Equipment Corporation (D.E.C.)
 
 This software was developed at the Digital Equipment Corporation
 Cambridge Research Laboratory.  Permission to copy this software, to
@@ -71,19 +71,13 @@ case.
     (if (null? filenames)
        (error "Can't find source files of compiler"))
     (set! source-filenames filenames))
-  (set! source-hash
-       (make/hash-table
-        101
-        string-hash-mod
-        (lambda (filename source-node)
-          (string=? filename (source-node/filename source-node)))
-        make/source-node))
+  (set! source-hash (make-string-hash-table))
   (set! source-nodes
        (map (lambda (filename)
-              (hash-table/intern! source-hash
-                                  filename
-                                  identity-procedure
-                                  identity-procedure))
+              (if (not (hash-table/get source-hash filename #f))
+                  (hash-table/put! source-hash
+                                   filename
+                                   (make/source-node filename))))
             source-filenames))
   (initialize/syntax-dependencies!)
   (initialize/integration-dependencies!)
@@ -116,10 +110,10 @@ case.
   (modification-time false))
 
 (define (filename->source-node filename)
-  (hash-table/lookup source-hash
-                    filename
-                    identity-procedure
-                    (lambda () (error "Unknown source file" filename))))
+  (let ((node (hash-table/get source-hash filename #f)))
+    (if (not node)
+       (error "Unknown source file:" filename))
+    node))
 
 (define (source-node/circular? node)
   (memq node (source-node/backward-closure node)))
index 5edede6da72dbb6177388afb765b90a4e731c5f2..cea0609c2314aebed51254e0d38b040ee95d8920 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/compiler.cbf,v 1.1 1988/11/05 22:31:00 cph Rel $
+$Id: compiler.cbf,v 1.2 1993/10/12 07:29:30 cph Exp $
 
-Copyright (c) 1988 Massachusetts Institute of Technology
+Copyright (c) 1988-93 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -34,12 +34,13 @@ MIT in each case. |#
 
 ;;;; Script to incrementally compile the compiler (from .bins)
 
-(for-each compile-directory
-         '("back"
-           "base"
-           "fggen"
-           "fgopt"
-           "machines/bobcat"
-           "rtlbase"
-           "rtlgen"
-           "rtlopt"))
\ No newline at end of file
+(fluid-let ((compiler:coalescing-constant-warnings? #f))
+  (for-each compile-directory
+           '("back"
+             "base"
+             "fggen"
+             "fgopt"
+             "machines/bobcat"
+             "rtlbase"
+             "rtlgen"
+             "rtlopt")))
\ No newline at end of file
index 011b4bd8504cdb690b7d34b6bc5b982d8b1cbbcb..e22541ab66a1b6d701bb3795929aab9588a95d70 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: compiler.pkg,v 1.46 1993/08/26 06:27:45 gjr Exp $
+$Id: compiler.pkg,v 1.47 1993/10/12 07:29:31 cph Exp $
 
 Copyright (c) 1988-1993 Massachusetts Institute of Technology
 
@@ -38,7 +38,6 @@ MIT in each case. |#
 
 (define-package (compiler)
   (files "base/switch"
-        "base/hashtb"
         "base/object"                  ;tagged object support
         "base/enumer"                  ;enumerations
         "base/sets"                    ;set abstraction
@@ -120,16 +119,6 @@ MIT in each case. |#
          reference-context?
          set-reference-context/offset!))
 
-(define-package (compiler balanced-binary-tree)
-  (files "base/btree")
-  (parent (compiler))
-  (export (compiler)
-         btree-delete!
-         btree-fringe
-         btree-insert!
-         btree-lookup
-         make-btree))
-
 (define-package (compiler macros)
   (files "base/macros")
   (parent ())
index 4b988ef8e3d3ad4793fa14a50ddc45181ffebee6..ec3e6d71df796a47448aa15731e38e769e487062 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Id: decls.scm,v 4.34 1992/11/18 03:56:42 gjr Exp $
+$Id: decls.scm,v 4.35 1993/10/12 07:29:32 cph Exp $
 
-Copyright (c) 1988-1992 Massachusetts Institute of Technology
+Copyright (c) 1988-93 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -69,19 +69,13 @@ MIT in each case. |#
     (if (null? filenames)
        (error "Can't find source files of compiler"))
     (set! source-filenames filenames))
-  (set! source-hash
-       (make/hash-table
-        101
-        string-hash-mod
-        (lambda (filename source-node)
-          (string=? filename (source-node/filename source-node)))
-        make/source-node))
+  (set! source-hash (make-string-hash-table))
   (set! source-nodes
        (map (lambda (filename)
-              (hash-table/intern! source-hash
-                                  filename
-                                  identity-procedure
-                                  identity-procedure))
+              (if (not (hash-table/get source-hash filename #f))
+                  (hash-table/put! source-hash
+                                   filename
+                                   (make/source-node filename))))
             source-filenames))
   (initialize/syntax-dependencies!)
   (initialize/integration-dependencies!)
@@ -114,10 +108,10 @@ MIT in each case. |#
   (modification-time false))
 
 (define (filename->source-node filename)
-  (hash-table/lookup source-hash
-                    filename
-                    identity-procedure
-                    (lambda () (error "Unknown source file" filename))))
+  (let ((node (hash-table/get source-hash filename #f)))
+    (if (not node)
+       (error "Unknown source file:" filename))
+    node))
 
 (define (source-node/circular? node)
   (memq node (source-node/backward-closure node)))
index ab857fc072f615e9f2918953e92fc36cd10ab356..57079ce42aa8ecb1eef1ea08cec501593652be5b 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/i386/compiler.cbf,v 1.2 1992/02/28 20:23:57 jinx Exp $
+$Id: compiler.cbf,v 1.3 1993/10/12 07:29:41 cph Exp $
 
-Copyright (c) 1992 Massachusetts Institute of Technology
+Copyright (c) 1992-93 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -34,12 +34,13 @@ MIT in each case. |#
 
 ;;;; Script to incrementally compile the compiler (from .bins)
 
-(for-each compile-directory
-         '("back"
-           "base"
-           "fggen"
-           "fgopt"
-           "machines/i386"
-           "rtlbase"
-           "rtlgen"
-           "rtlopt"))
\ No newline at end of file
+(fluid-let ((compiler:coalescing-constant-warnings? #f))
+  (for-each compile-directory
+           '("back"
+             "base"
+             "fggen"
+             "fgopt"
+             "machines/i386"
+             "rtlbase"
+             "rtlgen"
+             "rtlopt")))
\ No newline at end of file
index 824b2ab28988f7037616b8184dea2ac81d541286..a701976ed5e6c10333e1c5c208cd7b58459af4b0 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: compiler.pkg,v 1.18 1993/08/26 05:46:36 gjr Exp $
+$Id: compiler.pkg,v 1.19 1993/10/12 07:29:42 cph Exp $
 
 Copyright (c) 1992-1993 Massachusetts Institute of Technology
 
@@ -38,7 +38,6 @@ MIT in each case. |#
 
 (define-package (compiler)
   (files "base/switch"
-        "base/hashtb"
         "base/object"                  ;tagged object support
         "base/enumer"                  ;enumerations
         "base/sets"                    ;set abstraction
@@ -121,16 +120,6 @@ MIT in each case. |#
          reference-context?
          set-reference-context/offset!))
 
-(define-package (compiler balanced-binary-tree)
-  (files "base/btree")
-  (parent (compiler))
-  (export (compiler)
-         btree-delete!
-         btree-fringe
-         btree-insert!
-         btree-lookup
-         make-btree))
-
 (define-package (compiler macros)
   (files "base/macros")
   (parent ())
index 0ea209b8535392e2b68516dc26c026927b7181f2..dce8108a4be9935c8c0c31f53bc6192ef192af43 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: decls.scm,v 1.5 1993/07/16 19:27:46 gjr Exp $
+$Id: decls.scm,v 1.6 1993/10/12 07:29:43 cph Exp $
 
 Copyright (c) 1992-1993 Massachusetts Institute of Technology
 
@@ -69,19 +69,13 @@ MIT in each case. |#
     (if (null? filenames)
        (error "Can't find source files of compiler"))
     (set! source-filenames filenames))
-  (set! source-hash
-       (make/hash-table
-        101
-        string-hash-mod
-        (lambda (filename source-node)
-          (string=? filename (source-node/filename source-node)))
-        make/source-node))
+  (set! source-hash (make-string-hash-table))
   (set! source-nodes
        (map (lambda (filename)
-              (hash-table/intern! source-hash
-                                  filename
-                                  identity-procedure
-                                  identity-procedure))
+              (if (not (hash-table/get source-hash filename #f))
+                  (hash-table/put! source-hash
+                                   filename
+                                   (make/source-node filename))))
             source-filenames))
   (initialize/syntax-dependencies!)
   (initialize/integration-dependencies!)
@@ -114,10 +108,10 @@ MIT in each case. |#
   (modification-time false))
 
 (define (filename->source-node filename)
-  (hash-table/lookup source-hash
-                    filename
-                    identity-procedure
-                    (lambda () (error "Unknown source file" filename))))
+  (let ((node (hash-table/get source-hash filename #f)))
+    (if (not node)
+       (error "Unknown source file:" filename))
+    node))
 
 (define (source-node/circular? node)
   (memq node (source-node/backward-closure node)))
index 3e7882b479f9e2a2cf8875ddffc8efef40b7b6ed..ccc6ffc59fb3ea58dccbc0b37e56b498b51dcfb8 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/mips/compiler.cbf,v 1.1 1990/05/07 04:11:13 jinx Rel $
+$Id: compiler.cbf,v 1.2 1993/10/12 07:29:52 cph Exp $
 
-Copyright (c) 1988, 1989, 1990 Massachusetts Institute of Technology
+Copyright (c) 1988-93 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -34,12 +34,13 @@ MIT in each case. |#
 
 ;;;; Script to incrementally compile the compiler (from .bins)
 
-(for-each compile-directory
-         '("back"
-           "base"
-           "fggen"
-           "fgopt"
-           "machines/mips"
-           "rtlbase"
-           "rtlgen"
-           "rtlopt"))
\ No newline at end of file
+(fluid-let ((compiler:coalescing-constant-warnings? #f))
+  (for-each compile-directory
+           '("back"
+             "base"
+             "fggen"
+             "fgopt"
+             "machines/mips"
+             "rtlbase"
+             "rtlgen"
+             "rtlopt")))
\ No newline at end of file
index bf2fef3ac2adccd72de345b27f1b7817258724bb..252a7c619338143dc419d164a0570fedfd43efb0 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: compiler.pkg,v 1.16 1993/08/26 06:27:25 gjr Exp $
+$Id: compiler.pkg,v 1.17 1993/10/12 07:29:53 cph Exp $
 
 Copyright (c) 1988-1993 Massachusetts Institute of Technology
 
@@ -38,7 +38,6 @@ MIT in each case. |#
 
 (define-package (compiler)
   (files "base/switch"
-        "base/hashtb"
         "base/object"                  ;tagged object support
         "base/enumer"                  ;enumerations
         "base/sets"                    ;set abstraction
@@ -120,16 +119,6 @@ MIT in each case. |#
          reference-context?
          set-reference-context/offset!))
 
-(define-package (compiler balanced-binary-tree)
-  (files "base/btree")
-  (parent (compiler))
-  (export (compiler)
-         btree-delete!
-         btree-fringe
-         btree-insert!
-         btree-lookup
-         make-btree))
-
 (define-package (compiler macros)
   (files "base/macros")
   (parent ())
index 7bf22d200970f88ba0b28f10c778ba819378d0ab..60a0689d93d4c8f3e8f95bb1cea33576aaab6512 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Id: decls.scm,v 1.7 1992/11/18 03:51:47 gjr Exp $
+$Id: decls.scm,v 1.8 1993/10/12 07:29:53 cph Exp $
 
-Copyright (c) 1988-1992 Massachusetts Institute of Technology
+Copyright (c) 1988-93 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -69,19 +69,13 @@ MIT in each case. |#
     (if (null? filenames)
        (error "Can't find source files of compiler"))
     (set! source-filenames filenames))
-  (set! source-hash
-       (make/hash-table
-        101
-        string-hash-mod
-        (lambda (filename source-node)
-          (string=? filename (source-node/filename source-node)))
-        make/source-node))
+  (set! source-hash (make-string-hash-table))
   (set! source-nodes
        (map (lambda (filename)
-              (hash-table/intern! source-hash
-                                  filename
-                                  identity-procedure
-                                  identity-procedure))
+              (if (not (hash-table/get source-hash filename #f))
+                  (hash-table/put! source-hash
+                                   filename
+                                   (make/source-node filename))))
             source-filenames))
   (initialize/syntax-dependencies!)
   (initialize/integration-dependencies!)
@@ -114,10 +108,10 @@ MIT in each case. |#
   (modification-time false))
 
 (define (filename->source-node filename)
-  (hash-table/lookup source-hash
-                    filename
-                    identity-procedure
-                    (lambda () (error "Unknown source file" filename))))
+  (let ((node (hash-table/get source-hash filename #f)))
+    (if (not node)
+       (error "Unknown source file:" filename))
+    node))
 
 (define (source-node/circular? node)
   (memq node (source-node/backward-closure node)))
index 457a97f863cc762761560e602a66d97da2829747..441b752b8c36477c0a7ebc44873685c1dab809e1 100644 (file)
@@ -1,9 +1,8 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/sparc/decls.scm,v 1.1 1993/06/08 06:11:02 gjr Exp $
-$MC68020-Header: decls.scm,v 4.27 90/05/03 15:17:08 GMT jinx Exp $
+$Id: decls.scm,v 1.2 1993/10/12 07:30:02 cph Exp $
 
-Copyright (c) 1988-91 Massachusetts Institute of Technology
+Copyright (c) 1988-93 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -67,19 +66,13 @@ MIT in each case. |#
     (if (null? filenames)
        (error "Can't find source files of compiler"))
     (set! source-filenames filenames))
-  (set! source-hash
-       (make/hash-table
-        101
-        string-hash-mod
-        (lambda (filename source-node)
-          (string=? filename (source-node/filename source-node)))
-        make/source-node))
+  (set! source-hash (make-string-hash-table))
   (set! source-nodes
        (map (lambda (filename)
-              (hash-table/intern! source-hash
-                                  filename
-                                  identity-procedure
-                                  identity-procedure))
+              (if (not (hash-table/get source-hash filename #f))
+                  (hash-table/put! source-hash
+                                   filename
+                                   (make/source-node filename))))
             source-filenames))
   (initialize/syntax-dependencies!)
   (initialize/integration-dependencies!)
@@ -112,10 +105,10 @@ MIT in each case. |#
   (modification-time false))
 
 (define (filename->source-node filename)
-  (hash-table/lookup source-hash
-                    filename
-                    identity-procedure
-                    (lambda () (error "Unknown source file" filename))))
+  (let ((node (hash-table/get source-hash filename #f)))
+    (if (not node)
+       (error "Unknown source file:" filename))
+    node))
 
 (define (source-node/circular? node)
   (memq node (source-node/backward-closure node)))
index e150f5b217b42e08728f95929aab713255bd60e6..31047d48a355ec5db460e7b8646ef178435ad04e 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/spectrum/compiler.cbf,v 1.1 1990/01/29 21:29:09 jinx Rel $
+$Id: compiler.cbf,v 1.2 1993/10/12 07:30:11 cph Exp $
 
-Copyright (c) 1988, 1989 Massachusetts Institute of Technology
+Copyright (c) 1988-93 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -34,12 +34,13 @@ MIT in each case. |#
 
 ;;;; Script to incrementally compile the compiler (from .bins)
 
-(for-each compile-directory
-         '("back"
-           "base"
-           "fggen"
-           "fgopt"
-           "machines/spectrum"
-           "rtlbase"
-           "rtlgen"
-           "rtlopt"))
\ No newline at end of file
+(fluid-let ((compiler:coalescing-constant-warnings? #f))
+  (for-each compile-directory
+           '("back"
+             "base"
+             "fggen"
+             "fgopt"
+             "machines/spectrum"
+             "rtlbase"
+             "rtlgen"
+             "rtlopt")))
\ No newline at end of file
index 881f21c1ad8e5e8810f624ed0e863fdce9830ca8..0cd8da97035b9ab0c07e532f6a825f56fc5157fd 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: compiler.pkg,v 1.44 1993/08/26 06:26:56 gjr Exp $
+$Id: compiler.pkg,v 1.45 1993/10/12 07:30:11 cph Exp $
 
 Copyright (c) 1988-1993 Massachusetts Institute of Technology
 
@@ -38,7 +38,6 @@ MIT in each case. |#
 
 (define-package (compiler)
   (files "base/switch"
-        "base/hashtb"
         "base/object"                  ;tagged object support
         "base/enumer"                  ;enumerations
         "base/sets"                    ;set abstraction
@@ -120,16 +119,6 @@ MIT in each case. |#
          reference-context?
          set-reference-context/offset!))
 
-(define-package (compiler balanced-binary-tree)
-  (files "base/btree")
-  (parent (compiler))
-  (export (compiler)
-         btree-delete!
-         btree-fringe
-         btree-insert!
-         btree-lookup
-         make-btree))
-
 (define-package (compiler macros)
   (files "base/macros")
   (parent ())
index 192105cc63395dd67cfffde9933e7bfc57cab1ca..a82828a25e38a252a92094de3511ba58da36eb78 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Id: decls.scm,v 4.32 1992/11/18 00:46:26 gjr Exp $
+$Id: decls.scm,v 4.33 1993/10/12 07:30:13 cph Exp $
 
-Copyright (c) 1988-1992 Massachusetts Institute of Technology
+Copyright (c) 1988-93 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -69,19 +69,13 @@ MIT in each case. |#
     (if (null? filenames)
        (error "Can't find source files of compiler"))
     (set! source-filenames filenames))
-  (set! source-hash
-       (make/hash-table
-        101
-        string-hash-mod
-        (lambda (filename source-node)
-          (string=? filename (source-node/filename source-node)))
-        make/source-node))
+  (set! source-hash (make-string-hash-table))
   (set! source-nodes
        (map (lambda (filename)
-              (hash-table/intern! source-hash
-                                  filename
-                                  identity-procedure
-                                  identity-procedure))
+              (if (not (hash-table/get source-hash filename #f))
+                  (hash-table/put! source-hash
+                                   filename
+                                   (make/source-node filename))))
             source-filenames))
   (initialize/syntax-dependencies!)
   (initialize/integration-dependencies!)
@@ -114,10 +108,10 @@ MIT in each case. |#
   (modification-time false))
 
 (define (filename->source-node filename)
-  (hash-table/lookup source-hash
-                    filename
-                    identity-procedure
-                    (lambda () (error "Unknown source file" filename))))
+  (let ((node (hash-table/get source-hash filename #f)))
+    (if (not node)
+       (error "Unknown source file:" filename))
+    node))
 
 (define (source-node/circular? node)
   (memq node (source-node/backward-closure node)))
index ab105064b828e540955e749847e9db35971c08ac..4baab695bd1d89801e70e980d23f22d837af64be 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/vax/compiler.cbf,v 1.4 1991/02/15 00:41:03 jinx Exp $
+$Id: compiler.cbf,v 1.5 1993/10/12 07:30:28 cph Exp $
 
-Copyright (c) 1989, 1991 Massachusetts Institute of Technology
+Copyright (c) 1989-93 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -34,12 +34,13 @@ MIT in each case. |#
 
 ;;;; Script to incrementally compile the compiler (from .bins)
 
-(for-each compile-directory
-         '("back"
-           "base"
-           "fggen"
-           "fgopt"
-           "machines/vax"
-           "rtlbase"
-           "rtlgen"
-           "rtlopt"))
\ No newline at end of file
+(fluid-let ((compiler:coalescing-constant-warnings? #f))
+  (for-each compile-directory
+           '("back"
+             "base"
+             "fggen"
+             "fgopt"
+             "machines/vax"
+             "rtlbase"
+             "rtlgen"
+             "rtlopt")))
\ No newline at end of file
index 681a35ee49ce17758d433590f52936329ca7585d..fc77ff6e3a0455d10a30d755a3d547be3b8707a9 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: compiler.pkg,v 1.18 1993/08/26 06:33:36 gjr Exp $
+$Id: compiler.pkg,v 1.19 1993/10/12 07:30:28 cph Exp $
 
 Copyright (c) 1988-1993 Massachusetts Institute of Technology
 
@@ -38,7 +38,6 @@ MIT in each case. |#
 
 (define-package (compiler)
   (files "base/switch"
-        "base/hashtb"
         "base/object"                  ;tagged object support
         "base/enumer"                  ;enumerations
         "base/sets"                    ;set abstraction
@@ -120,16 +119,6 @@ MIT in each case. |#
          reference-context?
          set-reference-context/offset!))
 
-(define-package (compiler balanced-binary-tree)
-  (files "base/btree")
-  (parent (compiler))
-  (export (compiler)
-         btree-delete!
-         btree-fringe
-         btree-insert!
-         btree-lookup
-         make-btree))
-
 (define-package (compiler macros)
   (files "base/macros")
   (parent ())
index 0cea7d64d80c13649b829b0b00ec5e40a3aad236..6997eb2cd2d9dfeabccf173076e4f0024b8fc5d5 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Id: decls.scm,v 4.10 1992/11/18 03:54:51 gjr Exp $
+$Id: decls.scm,v 4.11 1993/10/12 07:30:29 cph Exp $
 
-Copyright (c) 1987-1992 Massachusetts Institute of Technology
+Copyright (c) 1987-93 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -69,19 +69,13 @@ MIT in each case. |#
     (if (null? filenames)
        (error "Can't find source files of compiler"))
     (set! source-filenames filenames))
-  (set! source-hash
-       (make/hash-table
-        101
-        string-hash-mod
-        (lambda (filename source-node)
-          (string=? filename (source-node/filename source-node)))
-        make/source-node))
+  (set! source-hash (make-string-hash-table))
   (set! source-nodes
        (map (lambda (filename)
-              (hash-table/intern! source-hash
-                                  filename
-                                  identity-procedure
-                                  identity-procedure))
+              (if (not (hash-table/get source-hash filename #f))
+                  (hash-table/put! source-hash
+                                   filename
+                                   (make/source-node filename))))
             source-filenames))
   (initialize/syntax-dependencies!)
   (initialize/integration-dependencies!)
@@ -114,10 +108,10 @@ MIT in each case. |#
   (modification-time false))
 
 (define (filename->source-node filename)
-  (hash-table/lookup source-hash
-                    filename
-                    identity-procedure
-                    (lambda () (error "Unknown source file" filename))))
+  (let ((node (hash-table/get source-hash filename #f)))
+    (if (not node)
+       (error "Unknown source file:" filename))
+    node))
 
 (define (source-node/circular? node)
   (memq node (source-node/backward-closure node)))
index 8fb10dcd4f3de2122051f580b4d875879753b095..fd8f94d218a891436f865d99d90357627e27033b 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: rtlobj.scm,v 4.10 1992/09/30 19:22:47 cph Exp $
+$Id: rtlobj.scm,v 4.11 1993/10/12 07:28:23 cph Exp $
 
 Copyright (c) 1988-92 Massachusetts Institute of Technology
 
@@ -112,25 +112,26 @@ MIT in each case. |#
 \f
 (define (make/label->object expression procedures continuations)
   (let ((hash-table
-        (symbol-hash-table/make
-         (1+ (+ (length procedures) (length continuations))))))
+        (make-eq-hash-table
+         (+ (if expression 1 0)
+            (length procedures)
+            (length continuations)))))
     (if expression
-       (symbol-hash-table/insert! hash-table
-                                  (rtl-expr/label expression)
-                                  expression))
+       (hash-table/put! hash-table
+                        (rtl-expr/label expression)
+                        expression))
     (for-each (lambda (procedure)
-               (symbol-hash-table/insert! hash-table
-                                          (rtl-procedure/label procedure)
-                                          procedure))
+               (hash-table/put! hash-table
+                                (rtl-procedure/label procedure)
+                                procedure))
              procedures)
     (for-each (lambda (continuation)
-               (symbol-hash-table/insert!
-                hash-table
-                (rtl-continuation/label continuation)
-                continuation))
+               (hash-table/put! hash-table
+                                (rtl-continuation/label continuation)
+                                continuation))
              continuations)
-    (make/label->object* hash-table)))
-
-(define (make/label->object* hash-table)
-  (lambda (label)
-    (symbol-hash-table/lookup hash-table label)))
\ No newline at end of file
+    (lambda (label)
+      (let ((datum (hash-table/get hash-table label #f)))
+       (if (not datum)
+           (error "Undefined label:" label))
+       datum))))
\ No newline at end of file