From 38818e2655e88db3901f313598362c173b5fb04b Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Tue, 12 Oct 1993 07:30:29 +0000 Subject: [PATCH] Eliminate "base/btree" and "base/hashtb" files. Rewrite code to use runtime system's rb-tree and hash-table abstractions. --- v7/src/compiler/back/symtab.scm | 36 +++++----- v7/src/compiler/base/infnew.scm | 66 +++++++++---------- v7/src/compiler/base/make.scm | 6 +- v7/src/compiler/machines/C/compiler.cbf | 23 +++---- v7/src/compiler/machines/C/compiler.pkg | 13 +--- v7/src/compiler/machines/C/decls.scm | 28 ++++---- v7/src/compiler/machines/alpha/compiler.cbf | 23 +++---- v7/src/compiler/machines/alpha/compiler.pkg | 13 +--- v7/src/compiler/machines/alpha/decls.scm | 28 ++++---- v7/src/compiler/machines/bobcat/compiler.cbf | 23 +++---- v7/src/compiler/machines/bobcat/compiler.pkg | 13 +--- v7/src/compiler/machines/bobcat/decls.scm | 28 ++++---- v7/src/compiler/machines/i386/compiler.cbf | 23 +++---- v7/src/compiler/machines/i386/compiler.pkg | 13 +--- v7/src/compiler/machines/i386/decls.scm | 26 +++----- v7/src/compiler/machines/mips/compiler.cbf | 23 +++---- v7/src/compiler/machines/mips/compiler.pkg | 13 +--- v7/src/compiler/machines/mips/decls.scm | 28 ++++---- v7/src/compiler/machines/sparc/decls.scm | 29 ++++---- .../compiler/machines/spectrum/compiler.cbf | 23 +++---- .../compiler/machines/spectrum/compiler.pkg | 13 +--- v7/src/compiler/machines/spectrum/decls.scm | 28 ++++---- v7/src/compiler/machines/vax/compiler.cbf | 23 +++---- v7/src/compiler/machines/vax/compiler.pkg | 13 +--- v7/src/compiler/machines/vax/decls.scm | 28 ++++---- v7/src/compiler/rtlbase/rtlobj.scm | 37 ++++++----- 26 files changed, 249 insertions(+), 371 deletions(-) diff --git a/v7/src/compiler/back/symtab.scm b/v7/src/compiler/back/symtab.scm index 296b9df33..3ca890b50 100644 --- a/v7/src/compiler/back/symtab.scm +++ b/v7/src/compiler/back/symtab.scm @@ -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)) (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 diff --git a/v7/src/compiler/base/infnew.scm b/v7/src/compiler/base/infnew.scm index 854cd2c42..2b4583d31 100644 --- a/v7/src/compiler/base/infnew.scm +++ b/v7/src/compiler/base/infnew.scm @@ -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 (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)) diff --git a/v7/src/compiler/base/make.scm b/v7/src/compiler/base/make.scm index f9b14f468..7ea1526ac 100644 --- a/v7/src/compiler/base/make.scm +++ b/v7/src/compiler/base/make.scm @@ -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 diff --git a/v7/src/compiler/machines/C/compiler.cbf b/v7/src/compiler/machines/C/compiler.cbf index a8323eae2..60297095f 100644 --- a/v7/src/compiler/machines/C/compiler.cbf +++ b/v7/src/compiler/machines/C/compiler.cbf @@ -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 diff --git a/v7/src/compiler/machines/C/compiler.pkg b/v7/src/compiler/machines/C/compiler.pkg index ba78f1f14..0fdd1c3af 100644 --- a/v7/src/compiler/machines/C/compiler.pkg +++ b/v7/src/compiler/machines/C/compiler.pkg @@ -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 ()) diff --git a/v7/src/compiler/machines/C/decls.scm b/v7/src/compiler/machines/C/decls.scm index 520b3f557..63d89db03 100644 --- a/v7/src/compiler/machines/C/decls.scm +++ b/v7/src/compiler/machines/C/decls.scm @@ -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))) diff --git a/v7/src/compiler/machines/alpha/compiler.cbf b/v7/src/compiler/machines/alpha/compiler.cbf index 51a9b322e..e21905308 100644 --- a/v7/src/compiler/machines/alpha/compiler.cbf +++ b/v7/src/compiler/machines/alpha/compiler.cbf @@ -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 diff --git a/v7/src/compiler/machines/alpha/compiler.pkg b/v7/src/compiler/machines/alpha/compiler.pkg index d89128fc7..87161bd9f 100644 --- a/v7/src/compiler/machines/alpha/compiler.pkg +++ b/v7/src/compiler/machines/alpha/compiler.pkg @@ -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 ()) diff --git a/v7/src/compiler/machines/alpha/decls.scm b/v7/src/compiler/machines/alpha/decls.scm index d7ab987a4..d8d03a4b0 100644 --- a/v7/src/compiler/machines/alpha/decls.scm +++ b/v7/src/compiler/machines/alpha/decls.scm @@ -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))) diff --git a/v7/src/compiler/machines/bobcat/compiler.cbf b/v7/src/compiler/machines/bobcat/compiler.cbf index 5edede6da..cea0609c2 100644 --- a/v7/src/compiler/machines/bobcat/compiler.cbf +++ b/v7/src/compiler/machines/bobcat/compiler.cbf @@ -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 diff --git a/v7/src/compiler/machines/bobcat/compiler.pkg b/v7/src/compiler/machines/bobcat/compiler.pkg index 011b4bd85..e22541ab6 100644 --- a/v7/src/compiler/machines/bobcat/compiler.pkg +++ b/v7/src/compiler/machines/bobcat/compiler.pkg @@ -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 ()) diff --git a/v7/src/compiler/machines/bobcat/decls.scm b/v7/src/compiler/machines/bobcat/decls.scm index 4b988ef8e..ec3e6d71d 100644 --- a/v7/src/compiler/machines/bobcat/decls.scm +++ b/v7/src/compiler/machines/bobcat/decls.scm @@ -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))) diff --git a/v7/src/compiler/machines/i386/compiler.cbf b/v7/src/compiler/machines/i386/compiler.cbf index ab857fc07..57079ce42 100644 --- a/v7/src/compiler/machines/i386/compiler.cbf +++ b/v7/src/compiler/machines/i386/compiler.cbf @@ -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 diff --git a/v7/src/compiler/machines/i386/compiler.pkg b/v7/src/compiler/machines/i386/compiler.pkg index 824b2ab28..a701976ed 100644 --- a/v7/src/compiler/machines/i386/compiler.pkg +++ b/v7/src/compiler/machines/i386/compiler.pkg @@ -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 ()) diff --git a/v7/src/compiler/machines/i386/decls.scm b/v7/src/compiler/machines/i386/decls.scm index 0ea209b85..dce8108a4 100644 --- a/v7/src/compiler/machines/i386/decls.scm +++ b/v7/src/compiler/machines/i386/decls.scm @@ -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))) diff --git a/v7/src/compiler/machines/mips/compiler.cbf b/v7/src/compiler/machines/mips/compiler.cbf index 3e7882b47..ccc6ffc59 100644 --- a/v7/src/compiler/machines/mips/compiler.cbf +++ b/v7/src/compiler/machines/mips/compiler.cbf @@ -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 diff --git a/v7/src/compiler/machines/mips/compiler.pkg b/v7/src/compiler/machines/mips/compiler.pkg index bf2fef3ac..252a7c619 100644 --- a/v7/src/compiler/machines/mips/compiler.pkg +++ b/v7/src/compiler/machines/mips/compiler.pkg @@ -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 ()) diff --git a/v7/src/compiler/machines/mips/decls.scm b/v7/src/compiler/machines/mips/decls.scm index 7bf22d200..60a0689d9 100644 --- a/v7/src/compiler/machines/mips/decls.scm +++ b/v7/src/compiler/machines/mips/decls.scm @@ -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))) diff --git a/v7/src/compiler/machines/sparc/decls.scm b/v7/src/compiler/machines/sparc/decls.scm index 457a97f86..441b752b8 100644 --- a/v7/src/compiler/machines/sparc/decls.scm +++ b/v7/src/compiler/machines/sparc/decls.scm @@ -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))) diff --git a/v7/src/compiler/machines/spectrum/compiler.cbf b/v7/src/compiler/machines/spectrum/compiler.cbf index e150f5b21..31047d48a 100644 --- a/v7/src/compiler/machines/spectrum/compiler.cbf +++ b/v7/src/compiler/machines/spectrum/compiler.cbf @@ -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 diff --git a/v7/src/compiler/machines/spectrum/compiler.pkg b/v7/src/compiler/machines/spectrum/compiler.pkg index 881f21c1a..0cd8da970 100644 --- a/v7/src/compiler/machines/spectrum/compiler.pkg +++ b/v7/src/compiler/machines/spectrum/compiler.pkg @@ -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 ()) diff --git a/v7/src/compiler/machines/spectrum/decls.scm b/v7/src/compiler/machines/spectrum/decls.scm index 192105cc6..a82828a25 100644 --- a/v7/src/compiler/machines/spectrum/decls.scm +++ b/v7/src/compiler/machines/spectrum/decls.scm @@ -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))) diff --git a/v7/src/compiler/machines/vax/compiler.cbf b/v7/src/compiler/machines/vax/compiler.cbf index ab105064b..4baab695b 100644 --- a/v7/src/compiler/machines/vax/compiler.cbf +++ b/v7/src/compiler/machines/vax/compiler.cbf @@ -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 diff --git a/v7/src/compiler/machines/vax/compiler.pkg b/v7/src/compiler/machines/vax/compiler.pkg index 681a35ee4..fc77ff6e3 100644 --- a/v7/src/compiler/machines/vax/compiler.pkg +++ b/v7/src/compiler/machines/vax/compiler.pkg @@ -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 ()) diff --git a/v7/src/compiler/machines/vax/decls.scm b/v7/src/compiler/machines/vax/decls.scm index 0cea7d64d..6997eb2cd 100644 --- a/v7/src/compiler/machines/vax/decls.scm +++ b/v7/src/compiler/machines/vax/decls.scm @@ -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))) diff --git a/v7/src/compiler/rtlbase/rtlobj.scm b/v7/src/compiler/rtlbase/rtlobj.scm index 8fb10dcd4..fd8f94d21 100644 --- a/v7/src/compiler/rtlbase/rtlobj.scm +++ b/v7/src/compiler/rtlbase/rtlobj.scm @@ -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. |# (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 -- 2.25.1