From 46ee8d611cdac155632bab8f69e4e0fa6badbed4 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sun, 31 Jul 2005 02:55:18 +0000 Subject: [PATCH] Eliminate use of primitive GET-NEXT-CONSTANT, which is to be removed from the microcode. Instead use GC-SPACE-STATUS to implement CONSTANT-SPACE/IN-USE. --- v7/src/runtime/boot.scm | 4 ++-- v7/src/runtime/gc.scm | 9 ++++----- v7/src/runtime/gcnote.scm | 4 ++-- v7/src/runtime/make.scm | 7 +------ v7/src/runtime/runtime.pkg | 4 ++-- v7/src/sf/gconst.scm | 5 ++--- 6 files changed, 13 insertions(+), 20 deletions(-) diff --git a/v7/src/runtime/boot.scm b/v7/src/runtime/boot.scm index da372f3e3..e21fdd668 100644 --- a/v7/src/runtime/boot.scm +++ b/v7/src/runtime/boot.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: boot.scm,v 14.20 2005/03/19 03:26:02 cph Exp $ +$Id: boot.scm,v 14.21 2005/07/31 02:54:29 cph Exp $ Copyright 1986,1987,1988,1989,1990,1992 Massachusetts Institute of Technology Copyright 1993,1996,2001,2004,2005 Massachusetts Institute of Technology @@ -114,7 +114,7 @@ USA. (define-primitives (object-pure? pure?) (object-constant? constant?) - get-next-constant) + gc-space-status) (define-integrable (future? object) ((ucode-primitive object-type? 2) (ucode-type future) object)) diff --git a/v7/src/runtime/gc.scm b/v7/src/runtime/gc.scm index 2ced720a7..6fbe693d8 100644 --- a/v7/src/runtime/gc.scm +++ b/v7/src/runtime/gc.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: gc.scm,v 14.18 2003/02/14 18:28:32 cph Exp $ +$Id: gc.scm,v 14.19 2005/07/31 02:54:33 cph Exp $ Copyright (c) 1988-1999 Massachusetts Institute of Technology @@ -223,7 +223,6 @@ USA. item) (define (constant-space/in-use) - (- (get-next-constant) constant-space/base)) - -;; This is set to the correct value during the cold load. -(define constant-space/base) \ No newline at end of file + (let ((v (gc-space-status))) + (- (vector-ref v 2) + (vector-ref v 1)))) \ No newline at end of file diff --git a/v7/src/runtime/gcnote.scm b/v7/src/runtime/gcnote.scm index fb56d1726..8546ea467 100644 --- a/v7/src/runtime/gcnote.scm +++ b/v7/src/runtime/gcnote.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: gcnote.scm,v 14.16 2003/02/14 18:28:32 cph Exp $ +$Id: gcnote.scm,v 14.17 2005/07/31 02:54:39 cph Exp $ Copyright (c) 1988-2000 Massachusetts Institute of Technology @@ -57,7 +57,7 @@ USA. (print-statistic statistic (notification-output-port))) (define (print-gc-statistics) - (let ((status ((ucode-primitive gc-space-status)))) + (let ((status (gc-space-status))) (let ((granularity (vector-ref status 0)) (write-number (lambda (n c) diff --git a/v7/src/runtime/make.scm b/v7/src/runtime/make.scm index a1673e8a0..6a47c3d9f 100644 --- a/v7/src/runtime/make.scm +++ b/v7/src/runtime/make.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: make.scm,v 14.98 2005/05/24 04:50:17 cph Exp $ +$Id: make.scm,v 14.99 2005/07/31 02:54:44 cph Exp $ Copyright 1988,1989,1990,1991,1992,1993 Massachusetts Institute of Technology Copyright 1994,1995,1996,1997,1998,2000 Massachusetts Institute of Technology @@ -99,7 +99,6 @@ USA. (define-integrable exit-with-value (ucode-primitive exit-with-value)) (define-integrable file-exists? (ucode-primitive file-exists? 1)) (define-integrable garbage-collect (ucode-primitive garbage-collect)) -(define-integrable get-next-constant (ucode-primitive get-next-constant)) (define-integrable get-primitive-name (ucode-primitive get-primitive-name)) (define-integrable lexical-reference (ucode-primitive lexical-reference)) (define-integrable link-variables (ucode-primitive link-variables 4)) @@ -153,7 +152,6 @@ USA. ;;;; GC, Interrupts, Errors (define safety-margin 4500) -(define constant-space/base (get-next-constant)) (let ((condition-handler/gc (lambda (interrupt-code interrupt-enables) @@ -381,9 +379,6 @@ USA. (load-files files1) (package-initialize '(RUNTIME GC-DAEMONS) 'INITIALIZE-PACKAGE! #t) (package-initialize '(RUNTIME GARBAGE-COLLECTOR) 'INITIALIZE-PACKAGE! #t) - (lexical-assignment (package-reference '(RUNTIME GARBAGE-COLLECTOR)) - 'CONSTANT-SPACE/BASE - constant-space/base) (package-initialize '(RUNTIME RANDOM-NUMBER) 'INITIALIZE-PACKAGE! #t) (package-initialize '(RUNTIME GENERIC-PROCEDURE) 'INITIALIZE-TAG-CONSTANTS! #t) diff --git a/v7/src/runtime/runtime.pkg b/v7/src/runtime/runtime.pkg index ad8520dae..f0c646562 100644 --- a/v7/src/runtime/runtime.pkg +++ b/v7/src/runtime/runtime.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: runtime.pkg,v 14.559 2005/07/16 03:44:22 cph Exp $ +$Id: runtime.pkg,v 14.560 2005/07/31 02:54:50 cph Exp $ Copyright 1988,1989,1990,1991,1992,1993 Massachusetts Institute of Technology Copyright 1994,1995,1996,1997,1998,1999 Massachusetts Institute of Technology @@ -140,7 +140,7 @@ USA. default-object? error:not-unparser-method future? - get-next-constant + gc-space-status guarantee-unparser-method interrupt-bit/after-gc interrupt-bit/gc diff --git a/v7/src/sf/gconst.scm b/v7/src/sf/gconst.scm index 1c0dad1f2..7da04e30b 100644 --- a/v7/src/sf/gconst.scm +++ b/v7/src/sf/gconst.scm @@ -1,9 +1,9 @@ #| -*-Scheme-*- -$Id: gconst.scm,v 4.31 2004/10/01 02:29:35 cph Exp $ +$Id: gconst.scm,v 4.32 2005/07/31 02:55:18 cph Exp $ Copyright 1987,1988,1989,1990,1991,1992 Massachusetts Institute of Technology -Copyright 1993,1994,1997,2001,2004 Massachusetts Institute of Technology +Copyright 1993,1994,1997,2001,2004,2005 Massachusetts Institute of Technology This file is part of MIT/GNU Scheme. @@ -135,7 +135,6 @@ USA. GENERAL-CAR-CDR GET-FIXED-OBJECTS-VECTOR GET-INTERRUPT-ENABLES - GET-NEXT-CONSTANT HUNK3-CONS INDEX-FIXNUM? INT:* -- 2.25.1