remove misplaced AVER
[sbcl.git] / src / code / early-fasl.lisp
index a6dd6b5..6c60a2a 100644 (file)
 ;;;   against.
 (defparameter *fasl-header-string-start-string* "# FASL")
 
+(macrolet ((define-fasl-format-features ()
+             (let (;; master value for *F-P-A-F-F*
+                   (fpaff '(:sb-thread :sb-package-locks :sb-unicode :gencgc :ud2-breakpoints)))
+               `(progn
+                  ;; a list of *(SHEBANG-)FEATURES* flags which affect
+                  ;; binary compatibility, i.e. which must be the same
+                  ;; between the SBCL which compiles the code and the
+                  ;; SBCL which executes the code
+                  ;;
+                  ;; This is a property of SBCL executables in the
+                  ;; abstract, not of this particular SBCL executable,
+                  ;; so any flag in this list may or may not be present
+                  ;; in the *FEATURES* list of this particular build.
+                  (defparameter *features-potentially-affecting-fasl-format*
+                    ',fpaff)
+                  ;; a string representing flags of *F-P-A-F-F* which
+                  ;; are in this particular build
+                  ;;
+                  ;; (A list is the natural logical representation for
+                  ;; this, but we represent it as a string because
+                  ;; that's physically convenient for writing to and
+                  ;; reading from fasl files, and because we don't
+                  ;; need to do anything sophisticated with its
+                  ;; logical structure, just test it for equality.)
+                  (defparameter *features-affecting-fasl-format*
+                    ,(let ((*print-pretty* nil))
+                       (prin1-to-string
+                        (sort
+                         (copy-seq
+                          (intersection sb-cold:*shebang-features* fpaff))
+                         #'string<
+                         :key #'symbol-name))))))))
+  (define-fasl-format-features))
+
 ;;; the code for a character which terminates a fasl file header
-(defconstant +fasl-header-string-stop-char-code+ 255)
+(def!constant +fasl-header-string-stop-char-code+ 255)
 
 ;;; This value should be incremented when the system changes in such a
 ;;; way that it will no longer work reliably with old fasl files. In
-;;; practice, I (WHN) fairly often neglect to increment it for CVS
+;;; practice, I (WHN) have often forgotten to increment it for CVS
 ;;; 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
-;;; 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
+(def!constant +fasl-file-version+ 78)
+;;; (description of versions before 0.9.0.1 deleted in 0.9.17)
+;;; 56: (2005-05-22) Something between 0.9.0.1 and 0.9.0.14. My money is
+;;;     on 0.9.0.6 (MORE CASE CONSISTENCY).
+;;; 57: (2005-06-12) Raw slot rearrangement in 0.9.1.38
+;;; 58: (2005-08-16) Multiple incompatible changes between 0.9.3 and 0.9.3.60
+;;; 59: (2005-09-18) METAOBJECT implementation, removal of INSTANCE and
+;;;     FUNCALLABLE-INSTANCE classes.
+;;; 60: (2005-10-24) Bumped for 0.9.6
+;;; 61: (2005-11-06) Improved source location recording added extra parameters
+;;;     to multiple %DEFMUMBLE functions.
+;;; 62: (2005-12-30) Make the count of FASL header counted strings
+;;;     a 32-bit value also on 64-bit platforms.
+;;; 63: (2006-01-27) Shuffle storage classes around to reduce the error
+;;;     trap information size on RISCy platforms.
+;;; 64: (2006-03-24) New calling convention for unknown-values on x86 and
+;;;     x86-64.  Also (belatedly) PPC/gencgc, including :gencgc on FPAFF.
+;;; 65: (2006-04-11) Package locking interface changed.
+;;; 66: (2006-05-13) Fopcompiler
+;;; 67: (2006-07-25) Reports on #lisp about 0.9.13 fasls being invalid on
+;;;     0.9.14.something
+;;; 68: (2006-08-14) changed number of arguments of LOAD-DEFMETHOD
+;;; 69: (2006-08-17) changed validity of various initargs for methods
+;;; 70: (2006-09-13) changes to *PSEUDO-ATOMIC* on x86 and x86-64
+;;; 71: (2006-11-19) CLOS calling convention changes
+;;; 72: (2006-12-05) Added slot to the primitive function type
+;;; 73: (2007-04-13) Changed a hash function
+;;; 74: (2007-06-05) UNWIND-TO-FRAME-AND-CALL
+;;; 75: (2007-08-06) FD-STREAM layout changes
+;;; 76: (2007-10-05) MUTEX layout changes
+;;; 77: (2007-11-08) Essentially obsolete fasl-file-version, fasls are now
+;;;     considered compatible only when the version numbers of the compiling
+;;;     SBCL instance is exactly the same as the one of the loading instance.
+;;;     Further fasl-file-version bumps should only be done for real changes
+;;;     in the fasl format, not for changes in function/macro signatures or
+;;;     lisp data structures.
+;;; 78: (2010-04-02) Add FOP-{SMALL-,}NAMED-PACKAGE, remove FOP-NORMAL-LOAD
+;;;     and FOP-MAYBE-COLD-LOAD.
 
 ;;; the conventional file extension for our fasl files
 (declaim (type simple-string *fasl-file-type*))
 (defvar *fasl-file-type* "fasl")
 \f
-;;; 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
 ;;;     with them. We can compare them with EQ.
-;;;   Foreign symbols are named by Lisp STRINGs: the Lisp package
-;;;     system doesn't extend out to symbols in languages like C.
-;;;     We want to use EQUAL to compare them.
-;;;   *STATIC-FOREIGN-SYMBOLS* are static as opposed to "dynamic" (not
-;;;     as opposed to C's "extern"). The table contains symbols known at 
-;;;     the time that the program was built, but not symbols defined
-;;;     in object files which have been loaded dynamically since then.
-(declaim (type hash-table *assembler-routines* *static-foreign-symbols*))
+(declaim (type hash-table *assembler-routines*))
 (defvar *assembler-routines* (make-hash-table :test 'eq))
-(defvar *static-foreign-symbols* (make-hash-table :test 'equal))
+
 \f
 ;;;; the FOP database
 
 ;;; which will perform the operation
 (defvar *fop-funs*
   (make-array 256
-             :initial-element (lambda ()
-                                (error "corrupt fasl file: losing FOP"))))
-\f
-;;;; other miscellaneous loading-related stuff
-
+              :initial-element (lambda ()
+                                 (error "corrupt fasl file: losing FOP"))))
 \f
 ;;;; variables
 
 (defvar *fasl-input-stream*)
 (declaim (type ansi-stream *fasl-input-stream*))
 
-(defvar *load-print* nil
-  #!+sb-doc
-  "the default for the :PRINT argument to LOAD")
-(defvar *load-verbose* nil
-  ;; Note that CMU CL's default for this was T, and ANSI says it's
-  ;; implementation-dependent. We choose NIL on the theory that it's
-  ;; a nicer default behavior for Unix programs.
-  #!+sb-doc
-  "the default for the :VERBOSE argument to LOAD")
-
 (defvar *load-code-verbose* nil)
-