From: Chris Hanson Date: Mon, 14 Apr 2003 19:56:21 +0000 (+0000) Subject: Change HOST-BIG-ENDIAN? to compute its value during cold load, so that X-Git-Tag: 20090517-FFI~1927 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=720e8d17cf24ad217278141ce32b6539d91a48be;p=mit-scheme.git Change HOST-BIG-ENDIAN? to compute its value during cold load, so that it is as fast as possible. --- diff --git a/v7/src/runtime/global.scm b/v7/src/runtime/global.scm index 0e54bedaa..cf278527d 100644 --- a/v7/src/runtime/global.scm +++ b/v7/src/runtime/global.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: global.scm,v 14.60 2003/04/14 18:19:23 cph Exp $ +$Id: global.scm,v 14.61 2003/04/14 19:56:15 cph Exp $ Copyright 1988,1989,1991,1992,1993,1995 Massachusetts Institute of Technology Copyright 1998,2000,2001,2003 Massachusetts Institute of Technology @@ -72,17 +72,25 @@ USA. system-vector-set!) (define (host-big-endian?) + host-big-endian?-saved) + +(define host-big-endian?-saved) + +(define (initialize-package!) ;; Assumptions: ;; * Word length is 32 or 64 bits. ;; * Type codes are at most 8 bits. ;; * Zero is a non-pointer type code. - (case (object-datum - (vector-ref (object-new-type (ucode-type vector) - "\000\001\002\000\000\003\004\000") - 1)) - ((#x00010200 #x0001020000030400) #t) - ((#x00020100 #x0004030000020100) #f) - (else (error "Unable to determine endianness of host.")))) + (set! host-big-endian?-saved + (case (object-datum + (vector-ref + (object-new-type (ucode-type vector) + "\000\001\002\000\000\003\004\000") + 1)) + ((#x00010200 #x0001020000030400) #t) + ((#x00020100 #x0004030000020100) #f) + (else (error "Unable to determine endianness of host.")))) + unspecific) ;;;; Potpourri diff --git a/v7/src/runtime/make.scm b/v7/src/runtime/make.scm index 43f2a29ed..47a44b439 100644 --- a/v7/src/runtime/make.scm +++ b/v7/src/runtime/make.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: make.scm,v 14.90 2003/02/28 04:40:06 cph Exp $ +$Id: make.scm,v 14.91 2003/04/14 19:56:18 cph Exp $ Copyright (c) 1988,1989,1990,1991,1992 Massachusetts Institute of Technology Copyright (c) 1993,1994,1995,1996,1997 Massachusetts Institute of Technology @@ -437,6 +437,7 @@ USA. ;; Basic data structures (RUNTIME NUMBER) ((RUNTIME NUMBER) INITIALIZE-DRAGON4! #t) + (RUNTIME MISCELLANEOUS-GLOBAL) (RUNTIME CHARACTER) (RUNTIME CHARACTER-SET) (RUNTIME GENSYM) diff --git a/v7/src/runtime/runtime.pkg b/v7/src/runtime/runtime.pkg index 3fdf5238e..2f00fb1c8 100644 --- a/v7/src/runtime/runtime.pkg +++ b/v7/src/runtime/runtime.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: runtime.pkg,v 14.443 2003/04/14 19:40:36 cph Exp $ +$Id: runtime.pkg,v 14.444 2003/04/14 19:56:21 cph Exp $ Copyright 1988,1989,1990,1991,1992,1993 Massachusetts Institute of Technology Copyright 1994,1995,1996,1997,1998,1999 Massachusetts Institute of Technology @@ -355,7 +355,8 @@ USA. with-history-disabled with-interrupt-mask with-values - write-to-string)) + write-to-string) + (initialization (initialize-package!))) (define-package (runtime alternative-lambda) (files "lambdx")