From: Christophe R. <cr...@us...> - 2002-05-30 12:30:56
|
Update of /cvsroot/sbcl/sbcl/src/code In directory usw-pr-cvs1:/tmp/cvs-serv24462/src/code Modified Files: defbangstruct.lisp target-defstruct.lisp Added Files: cross-make-load-form.lisp Log Message: 0.7.4.7: Slightly sanitized version of CSR "MAKE-LOAD-FORM bootstrapping problem" sbcl-devel 2002-05-27 ... write and use SB!XC:MAKE-LOAD-FORM-SAVING-SLOTS ... make the magic symbol :SB-JUST-DUMP-IT-NORMALLY; should now be arbitrarily changeable Minor unrelated cleanups to text files --- NEW FILE: cross-make-load-form.lisp --- ;;;; cross-compile-time-only replacements for make-load-form ;;;; machinery. ;;;; This software is part of the SBCL system. See the README file for ;;;; more information. ;;;; ;;;; This software is derived from the CMU CL system, which was ;;;; written at Carnegie Mellon University and released into the ;;;; public domain. The software is in the public domain and is ;;;; provided with absolutely no warranty. See the COPYING and CREDITS ;;;; files for more information. ;;; this probably deserves a word of explanation, as somewhat ;;; unusually we require the behaviour of this function to change ;;; depending on not at what stage we build it but at what stage we ;;; run it. This function will be called both when the host compiler ;;; dumps structures of type structure!object and when the ;;; cross-compiler does likewise; we don't control the dumper for the ;;; host compiler, so we use its own machinery for dumping host fasls, ;;; but we need to use target machinery for target fasls. We therefore ;;; dispatch on the presence of :SB-XC-HOST in the *FEATURES* list for ;;; which mechanism to use. This probably counts as a KLUDGE; a proper ;;; solution might be one or more of: ;;; ;;; * change def!struct to have two make-load-form-funs associated ;;; with it; one to run when CL:MAKE-LOAD-FORM is called, and one ;;; for SB!XC:MAKE-LOAD-FORM ;;; ;;; * implement MAKE-LOAD-FORM-SAVING-SLOTS properly rather than have ;;; this magic value, and use it consistently. ;;; ;;; Also, something along these lines can remove the special case in ;;; EMIT-MAKE-LOAD-FORM in src/compiler/main.lisp. (defun sb!xc:make-load-form-saving-slots (object &rest args &key slot-names environment) (declare (ignore environment)) (if (member :sb-xc-host *features*) ;; we're still building the cross-compiler, so use the host's ;; mechanism: (apply #'make-load-form-saving-slots object args) ;; we're building cold fasls, so use the target's mechanism: ;; ;; KLUDGE: This is essentially the same definition as for the ;; target's MAKE-LOAD-FORM-SAVING-SLOTS; it would be nice to ;; share code with that if possible. -- CSR, 2002-05-30 (if slot-names (bug "MAKE-LOAD-FORM-SAVING-SLOTS ~ called with :SLOT-NAMES argument during cross-compilation") :sb-just-dump-it-normally))) Index: defbangstruct.lisp =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/code/defbangstruct.lisp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- defbangstruct.lisp 31 Oct 2001 17:51:05 -0000 1.10 +++ defbangstruct.lisp 30 May 2002 12:30:53 -0000 1.11 @@ -76,8 +76,8 @@ (defun just-dump-it-normally (object &optional (env nil env-p)) (declare (type structure!object object)) (if env-p - (make-load-form-saving-slots object :environment env) - (make-load-form-saving-slots object))) + (sb!xc:make-load-form-saving-slots object :environment env) + (sb!xc:make-load-form-saving-slots object))) ;;; a MAKE-LOAD-FORM function for objects which don't use the load ;;; form system. This is used for LAYOUT objects because the special Index: target-defstruct.lisp =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/code/target-defstruct.lisp,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- target-defstruct.lisp 28 May 2002 22:06:57 -0000 1.18 +++ target-defstruct.lisp 30 May 2002 12:30:53 -0000 1.19 @@ -452,7 +452,7 @@ (declare (ignore object environment)) (if slot-names (error "stub: MAKE-LOAD-FORM-SAVING-SLOTS :SLOT-NAMES not implemented") ; KLUDGE - :just-dump-it-normally)) + :sb-just-dump-it-normally)) ;;;; testing structure types |