From aca45f35fc54bc29e2c79397e3538ff27f6e0db9 Mon Sep 17 00:00:00 2001 From: William Harold Newman Date: Sat, 16 Mar 2002 16:12:30 +0000 Subject: [PATCH] 0.7.1.41: more ordinary name (one *FEATURES* symbol, not two) for the opposed pair of stack-grows-upward and stack-grows-downward concepts ...replaced old pair of features with new :CONTROL-STACK-GROWS-DOWNWARD-NOT-UPWARD feature ...#!+STACK-GROWS-DOWNWARD becomes #!+CONTROL-STACK-GROWS-DOWNWARD-NOT-UPWARD ...#!+STACK-GROWS-UPWARD becomes #!-CONTROL-STACK-GROWS-DOWNWARD-NOT-UPWARD Since references to the new STACK-EXHAUSTION stuff can be automatically written into fasl files, the fasl file version needs to be incremented. --- base-target-features.lisp-expr | 14 +++++++--- make-config.sh | 11 ++++---- src/code/debug-int.lisp | 4 +-- src/code/early-fasl.lisp | 59 ++++------------------------------------ src/code/exhaust.lisp | 29 +++++++++++--------- src/code/gc.lisp | 11 ++++---- src/code/toplevel.lisp | 4 +-- version.lisp-expr | 2 +- 8 files changed, 49 insertions(+), 85 deletions(-) diff --git a/base-target-features.lisp-expr b/base-target-features.lisp-expr index 3304865..519c506 100644 --- a/base-target-features.lisp-expr +++ b/base-target-features.lisp-expr @@ -249,11 +249,17 @@ ;; present but stale in SBCL as of 0.6.12.) ;; ;; properties derived from the machine architecture - ;; :stack-grows-downward, :stack-grows-downward - ;; One of these two should be present in the features list of any - ;; CPU supported as of sbcl-0.7.1.29. On the X86, the system stack - ;; grows downward. On the other supported CPU architectures, the + ;; :control-stack-grows-downward-not-upward + ;; On the X86, the Lisp control stack grows downward. On the + ;; other supported CPU architectures as of sbcl-0.7.1.40, the ;; system stack grows upward. + ;; Note that there are other stack-related differences between the + ;; X86 port and the other ports. E.g. on the X86, the Lisp control + ;; stack coincides with the C stack, meaning that on the X86 there's + ;; stuff on the control stack that the Lisp-level debugger doesn't + ;; understand very well. As of sbcl-0.7.1.40 things like that are + ;; just parameterized by #!+X86, but it'd probably be better to + ;; use new flags like :CONTROL-STACK-CONTAINS-C-STACK. ;; ;; operating system features: ;; :linux = We're intended to run under some version of Linux. diff --git a/make-config.sh b/make-config.sh index 7000fcc..8907833 100644 --- a/make-config.sh +++ b/make-config.sh @@ -51,17 +51,18 @@ if [ "$sbcl_arch" = "" ] ; then fi echo -n ":$sbcl_arch" >> $ltf # KLUDGE: currently the x86 only works with the generational garbage -# collector (indicated by the presence of :gencgc in *features*) and +# collector (indicated by the presence of :GENCGC in *FEATURES*) and # alpha, sparc and ppc with the stop'n'copy collector (indicated by -# the absence of :gencgc in *features*). This isn't a great -# separation, but for now, rather than have :gencgc in +# the absence of :GENCGC in *FEATURES*). This isn't a great +# separation, but for now, rather than have :GENCGC in # base-target-features.lisp-expr, we add it into local-target-features # if we're building for x86. -- CSR, 2002-02-21 Then we do something # similar with :STACK-GROWS-FOOWARD, too. -- WHN 2002-03-03 if [ "$sbcl_arch" = "x86" ] ; then - echo -n ' :gencgc :stack-grows-downward' >> $ltf + echo -n ' :gencgc :stack-grows-downward-not-upward' >> $ltf else - echo -n ' :stack-grows-upward' >> $ltf + # Nothing need be done in this case, but sh syntax wants a placeholder. + echo > /dev/null fi for d in src/compiler src/assembly; do echo //setting up symlink $d/target diff --git a/src/code/debug-int.lisp b/src/code/debug-int.lisp index 2137c0a..db17f75 100644 --- a/src/code/debug-int.lisp +++ b/src/code/debug-int.lisp @@ -527,12 +527,12 @@ #!-sb-fluid (declaim (inline control-stack-pointer-valid-p)) (defun control-stack-pointer-valid-p (x) (declare (type system-area-pointer x)) - #!+stack-grows-upward + #!-stack-grows-downward-not-upward (and (sap< x (current-sp)) (sap<= (int-sap control-stack-start) x) (zerop (logand (sap-int x) #b11))) - #!+stack-grows-downward + #!+stack-grows-downward-not-upward (and (sap>= x (current-sp)) (sap> (int-sap control-stack-end) x) (zerop (logand (sap-int x) #b11)))) diff --git a/src/code/early-fasl.lisp b/src/code/early-fasl.lisp index a6dd6b5..6defa1c 100644 --- a/src/code/early-fasl.lisp +++ b/src/code/early-fasl.lisp @@ -42,68 +42,21 @@ ;;; versions which break binary compatibility. But it certainly should ;;; be incremented for release versions which break binary ;;; compatibility. -(defconstant +fasl-file-version+ 24) -;;; 2 = sbcl-0.6.4 uses COMPILE-OR-LOAD-DEFGENERIC. -;;; 3 = sbcl-0.6.6 uses private symbol, not :EMPTY, for empty HASH-TABLE slot. -;;; 4 = sbcl-0.6.7 uses HAIRY-DATA-VECTOR-REF and HAIRY-DATA-VECTOR-SET -;;; when array headers or data element type uncertainty exist, and -;;; uses DATA-VECTOR-REF and DATA-VECTOR-SET only for VOPs. (Thus, -;;; full calls to DATA-VECTOR-REF and DATA-VECTOR-SET from older -;;; fasl files would fail, because there are no DEFUNs for these -;;; operations any more.) -;;; 5 = sbcl-0.6.8 has rearranged static symbols. -;;; 6 = sbcl-0.6.9, got rid of non-ANSI %DEFCONSTANT/%%DEFCONSTANT stuff -;;; and deleted a slot from DEBUG-SOURCE structure. -;;; 7 = around sbcl-0.6.9.8, merged SB-CONDITIONS package into SB-KERNEL -;;; 8 = sbcl-0.6.10.4 revived Gray stream support, changing stream layouts. -;;; 9 = deleted obsolete CONS-UNIQUE-TAG bytecode in sbcl-0.6.11.8 -;;; (somewhere in here also changes to AND and OR CTYPE layouts) -;;; 10 = new layout for CONDITION in sbcl-0.6.11.38 -;;; 11 = (a) new helper functions for MAKE-LOAD-FORM (HASH-TABLE) in -;;; sbcl-0.6.12.11 -;;; (b) new address space constants for OpenBSD in 0.6.12.17 -;;; (doesn't need separate version from (a) because the -;;; OpenBSD port was broken from sometime before 0.6.12.11 -;;; until the address space was changed) -;;; 12 = sbcl-0.6.12.22 added new SB-FASL package -;;; 13 = sbcl-0.6.12.28 removed some elements from *STATIC-SYMBOLS* -;;; 14 = sbcl-0.6.12.29 removed more elements from *STATIC-SYMBOLS* -;;; 15 = sbcl-0.6.12.33 changed the layout of STREAM -;;; 16 = sbcl-0.pre7.15 changed the layout of PRETTY-STREAM -;;; 17 = sbcl-0.pre7.38 (merging many changes accumulated in -;;; the sbcl-0.pre7.37.flaky5.* branch back into the main branch) -;;; got rid of byte compiler, byte interpreter, and IR1 -;;; interpreter, changed %DEFUN and DEFSTRUCT, changed the -;;; meaning of FOP-FSET, and changed the layouts of various -;;; internal compiler structures (e.g. DEFSTRUCT CLAMBDA) -;;; 18 = sbcl-0.pre7.39 swapped FUNCTION-POINTER-TYPE and -;;; INSTANCE-POINTER-LOWTAG low-level type codes to help with -;;; the PPC port -;;; (In 0.pre7.48, the low-level object layout of SYMBOL on the -;;; non-X86 ports changed. I forgot to bump the fasl version number: -;;; I only have an X86.. -- WHN) -;;; 19 = sbcl-0.pre7.50 deleted byte-compiler-related low-level type codes -;;; 20 = sbcl-0.pre7.51 modified names and layouts of -;;; physical-environment-related structures in the compiler -;;; 21 = sbcl-0.pre7.62 finally incremented the version after several -;;; incompatible changes in earlier versions: many many symbols -;;; renamed, changes in globaldb representation of constants -;;; and inline functions, and change in the value of -;;; INTERNAL-TIME-UNITS-PER-SECOND -;;; 22 = about a zillion changes between sbcl-0.pre7.62 and -;;; sbcl-0.pre7.133, during which time it seemed too much -;;; trouble to increment the counter +(defconstant +fasl-file-version+ 25) +;;; (record of versions before 0.7.0 deleted in 0.7.1.41) ;;; 23 = sbcl-0.7.0.1 deleted no-longer-used EVAL-STACK stuff, ;;; causing changes in *STATIC-SYMBOLS*. ;;; 24 = sbcl-0.7.1.19 changed PCL service routines which might be ;;; called from macroexpanded code +;;; 25 = sbcl-0.7.1.41 (and immediately preceding versions, actually) +;;; introduced new functions to check for control stack exhaustion ;;; the conventional file extension for our fasl files (declaim (type simple-string *fasl-file-type*)) (defvar *fasl-file-type* "fasl") -;;; information about below-Lisp-level linkage -;;; +;;;; information about below-Lisp-level linkage + ;;; Note: ;;; Assembler routines are named by full Lisp symbols: they ;;; have packages and that sort of native Lisp stuff associated diff --git a/src/code/exhaust.lisp b/src/code/exhaust.lisp index 88f1954..25c038e 100644 --- a/src/code/exhaust.lisp +++ b/src/code/exhaust.lisp @@ -30,18 +30,18 @@ (let (;; initial difference between soft limit and hard limit (initial-slack (expt 2 20))) (setf *control-stack-exhaustion-sap* - (int-sap #!+stack-grows-downward (+ sb!vm:control-stack-start - initial-slack) - #!+stack-grows-upward (- sb!vm:control-stack-end - initial-slack))))) + (int-sap #!+stack-grows-downward-not-upward + (+ sb!vm:control-stack-start initial-slack) + #!-stack-grows-downward-not-upward + (- sb!vm:control-stack-end initial-slack))))) ;;; FIXME: Even though this is only called when (> SAFETY (MAX SPEED SPACE)) ;;; it's still annoyingly wasteful for it to be a full function call. ;;; It should probably be a VOP calling an assembly routine or something ;;; like that. (defun %detect-stack-exhaustion () - (when (#!+stack-grows-upward sap>= - #!+stack-grows-downward sap<= + (when (#!-stack-grows-downward-not-upward sap>= + #!+stack-grows-downward-not-upward sap<= (current-sp) *control-stack-exhaustion-sap*) (let ((*control-stack-exhaustion-sap* @@ -60,11 +60,14 @@ ;;; the (continuing) stack overflow. (defun revised-control-stack-exhaustion-sap () (let* ((old-slack - #!+stack-grows-upward (- sb!vm:control-stack-end - (sap-int *control-stack-exhaustion-sap*)) - #!+stack-grows-downward (- (sap-int *control-stack-exhaustion-sap*) - sb!vm:control-stack-start)) + #!-stack-grows-downward-not-upward + (- sb!vm:control-stack-end + (sap-int *control-stack-exhaustion-sap*)) + #!+stack-grows-downward-not-upward + (- (sap-int *control-stack-exhaustion-sap*) + sb!vm:control-stack-start)) (new-slack (ash old-slack -1))) - (int-sap - #!+stack-grows-upward (- sb!vm:control-stack-end new-slack) - #!+stack-grows-downward (+ sb!vm:control-stack-start new-slack)))) + (int-sap #!-stack-grows-downward-not-upward + (- sb!vm:control-stack-end new-slack) + #!+stack-grows-downward-not-upward + (+ sb!vm:control-stack-start new-slack)))) diff --git a/src/code/gc.lisp b/src/code/gc.lisp index bfeb927..e623c9e 100644 --- a/src/code/gc.lisp +++ b/src/code/gc.lisp @@ -50,11 +50,12 @@ sb!vm:read-only-space-start)) (defun control-stack-usage () - #!+stack-grows-upward (- (sb!sys:sap-int (sb!c::control-stack-pointer-sap)) - sb!vm:control-stack-start) - #!+stack-grows-downward (- sb!vm:control-stack-end - (sb!sys:sap-int - (sb!c::control-stack-pointer-sap)))) + #!-stack-grows-downward-not-upward + (- (sb!sys:sap-int (sb!c::control-stack-pointer-sap)) + sb!vm:control-stack-start) + #!+stack-grows-downward-not-upward + (- sb!vm:control-stack-end + (sb!sys:sap-int (sb!c::control-stack-pointer-sap)))) (defun binding-stack-usage () (- (sb!sys:sap-int (sb!c::binding-stack-pointer-sap)) diff --git a/src/code/toplevel.lisp b/src/code/toplevel.lisp index 7389eb5..a53794b 100644 --- a/src/code/toplevel.lisp +++ b/src/code/toplevel.lisp @@ -163,7 +163,7 @@ (declare (optimize (speed 3) (safety 0)) (values (unsigned-byte 20))) ; FIXME: DECLARE VALUES? - #!+stack-grows-upward + #!-stack-grows-downward-not-upward (labels ((scrub (ptr offset count) (declare (type system-area-pointer ptr) @@ -193,7 +193,7 @@ (* (floor initial-offset sb!vm:n-word-bytes) sb!vm:n-word-bytes) 0))) - #!+stack-grows-downward + #!+stack-grows-downward-not-upward (labels ((scrub (ptr offset count) (declare (type system-area-pointer ptr) diff --git a/version.lisp-expr b/version.lisp-expr index 0f2157b..dc0c0f8 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -18,4 +18,4 @@ ;;; for internal versions, especially for internal versions off the ;;; main CVS branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.7.1.40" +"0.7.1.41" -- 1.7.10.4