Index: build-order.lisp-expr
===================================================================
RCS file: /cvsroot/sbcl/sbcl/build-order.lisp-expr,v
retrieving revision 1.77
diff -u -r1.77 build-order.lisp-expr
--- build-order.lisp-expr	27 Dec 2006 00:37:30 -0000	1.77
+++ build-order.lisp-expr	14 Jan 2007 02:49:27 -0000
@@ -344,6 +344,9 @@
  ;; DEFINE-STORAGE-CLASS, needed by target/vm.lisp
  ("src/compiler/meta-vmdef")
 
+ ;; for CATCH-BLOCK-SIZE, needed by target/vm.lisp
+ ("src/compiler/generic/not-so-early-objdef")
+
  ;; for e.g. DESCRIPTOR-REG, needed by primtype.lisp
  ("src/compiler/target/vm")
 
Index: src/compiler/alpha/vm.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/alpha/vm.lisp,v
retrieving revision 1.15
diff -u -r1.15 vm.lisp
--- src/compiler/alpha/vm.lisp	7 Feb 2006 02:35:25 -0000	1.15
+++ src/compiler/alpha/vm.lisp	14 Jan 2007 02:49:27 -0000
@@ -117,8 +117,6 @@
       ((null classes)
        (nreverse forms))))
 
-(def!constant kludge-nondeterministic-catch-block-size 7)
-
 (!define-storage-classes
 
   ;; non-immediate constants in the constant pool
@@ -244,7 +242,7 @@
 
   ;; A catch or unwind block.
   (catch-block control-stack
-               :element-size kludge-nondeterministic-catch-block-size))
+               :element-size catch-block-size))
 
 ;;; Make some random tns for important registers.
 (macrolet ((defregtn (name sc)
Index: src/compiler/generic/not-so-early-objdef.lisp
===================================================================
RCS file: src/compiler/generic/not-so-early-objdef.lisp
diff -N src/compiler/generic/not-so-early-objdef.lisp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ src/compiler/generic/not-so-early-objdef.lisp	14 Jan 2007 02:49:27 -0000
@@ -0,0 +1,46 @@
+;;;; machine-independent aspects of the object representation
+
+;;;; 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.
+
+(in-package "SB!VM")
+
+;;;; NOTE: These definitions are here so that they are available
+;;;; to the code in compiler/target/vm.lisp (most notably the
+;;;; size of a CATCH-BLOCK).  The support for DEFKNOWN is not
+;;;; yet loaded, so most of the functionality of
+;;;; DEFINE-PRIMITIVE-OBJECT is unavailable to us.
+
+;;;; other non-heap data blocks
+
+(define-primitive-object (binding)
+  value
+  symbol)
+
+(define-primitive-object (unwind-block)
+  (current-uwp :c-type #!-alpha "struct unwind_block *" #!+alpha "u32")
+  (current-cont :c-type #!-alpha "lispobj *" #!+alpha "u32")
+  #!-(or x86 x86-64) current-code
+  entry-pc
+  #!+win32 next-seh-frame
+  #!+win32 seh-frame-handler)
+
+(define-primitive-object (catch-block)
+  (current-uwp :c-type #!-alpha "struct unwind_block *" #!+alpha "u32")
+  (current-cont :c-type #!-alpha "lispobj *" #!+alpha "u32")
+  #!-(or x86 x86-64) current-code
+  entry-pc
+  #!+win32 next-seh-frame
+  #!+win32 seh-frame-handler
+  tag
+  (previous-catch :c-type #!-alpha "struct catch_block *" #!+alpha "u32")
+  ;; FIXME: Is this SIZE slot really necessary?  It doesn't seem
+  ;; to be used, and removing it on x86 doesn't appear to break
+  ;; anything.
+  size)
Index: src/compiler/generic/objdef.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/generic/objdef.lisp,v
retrieving revision 1.52
diff -u -r1.52 objdef.lisp
--- src/compiler/generic/objdef.lisp	13 Jan 2007 21:05:34 -0000	1.52
+++ src/compiler/generic/objdef.lisp	14 Jan 2007 02:49:28 -0000
@@ -268,35 +268,6 @@
           :ref-trans sb!c::%weak-pointer-broken :ref-known (flushable)
           :init :null)
   (next :c-type #!-alpha "struct weak_pointer *" #!+alpha "u32"))
-
-;;;; other non-heap data blocks
-
-(define-primitive-object (binding)
-  value
-  symbol)
-
-(define-primitive-object (unwind-block)
-  (current-uwp :c-type #!-alpha "struct unwind_block *" #!+alpha "u32")
-  (current-cont :c-type #!-alpha "lispobj *" #!+alpha "u32")
-  #!-(or x86 x86-64) current-code
-  entry-pc
-  #!+win32 next-seh-frame
-  #!+win32 seh-frame-handler)
-
-(define-primitive-object (catch-block)
-  (current-uwp :c-type #!-alpha "struct unwind_block *" #!+alpha "u32")
-  (current-cont :c-type #!-alpha "lispobj *" #!+alpha "u32")
-  #!-(or x86 x86-64) current-code
-  entry-pc
-  #!+win32 next-seh-frame
-  #!+win32 seh-frame-handler
-  tag
-  (previous-catch :c-type #!-alpha "struct catch_block *" #!+alpha "u32")
-  size)
-
-;;; (For an explanation of this, see the comments at the definition of
-;;; KLUDGE-NONDETERMINISTIC-CATCH-BLOCK-SIZE.)
-(aver (= kludge-nondeterministic-catch-block-size catch-block-size))
 
 ;;;; symbols
 
Index: src/compiler/hppa/vm.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/hppa/vm.lisp,v
retrieving revision 1.10
diff -u -r1.10 vm.lisp
--- src/compiler/hppa/vm.lisp	7 Feb 2006 02:35:25 -0000	1.10
+++ src/compiler/hppa/vm.lisp	14 Jan 2007 02:49:28 -0000
@@ -110,8 +110,6 @@
       ((null classes)
        (nreverse forms))))
 
-(def!constant kludge-nondeterministic-catch-block-size 7)
-
 (!define-storage-classes
 
   ;; Non-immediate contstants in the constant pool
@@ -233,7 +231,7 @@
    :alternate-scs (complex-double-stack))
 
   ;; A catch or unwind block.
-  (catch-block control-stack :element-size kludge-nondeterministic-catch-block-size))
+  (catch-block control-stack :element-size catch-block-size))
 
 
 ;;;; Make some random tns for important registers.
Index: src/compiler/mips/vm.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/mips/vm.lisp,v
retrieving revision 1.15
diff -u -r1.15 vm.lisp
--- src/compiler/mips/vm.lisp	7 Feb 2006 02:35:25 -0000	1.15
+++ src/compiler/mips/vm.lisp	14 Jan 2007 02:49:28 -0000
@@ -115,8 +115,6 @@
       ((null classes)
        (nreverse forms))))
 
-(def!constant kludge-nondeterministic-catch-block-size 7)
-
 (!define-storage-classes
 
   ;; Non-immediate constants in the constant pool
@@ -247,7 +245,7 @@
    :alternate-scs (complex-double-stack))
 
   ;; A catch or unwind block.
-  (catch-block control-stack :element-size kludge-nondeterministic-catch-block-size)
+  (catch-block control-stack :element-size catch-block-size)
 
   ;; floating point numbers temporarily stuck in integer registers for c-call
   (single-int-carg-reg registers
Index: src/compiler/ppc/vm.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/ppc/vm.lisp,v
retrieving revision 1.14
diff -u -r1.14 vm.lisp
--- src/compiler/ppc/vm.lisp	7 Feb 2006 02:35:25 -0000	1.14
+++ src/compiler/ppc/vm.lisp	14 Jan 2007 02:49:28 -0000
@@ -118,8 +118,6 @@
       ((null classes)
        (nreverse forms))))
 
-(def!constant kludge-nondeterministic-catch-block-size 7)
-
 (define-storage-classes
 
   ;; Non-immediate contstants in the constant pool
@@ -244,7 +242,7 @@
 
   ;; A catch or unwind block.
   (catch-block control-stack
-               :element-size kludge-nondeterministic-catch-block-size))
+               :element-size catch-block-size))
 
 ;;;; Make some random tns for important registers.
 
Index: src/compiler/sparc/vm.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/sparc/vm.lisp,v
retrieving revision 1.13
diff -u -r1.13 vm.lisp
--- src/compiler/sparc/vm.lisp	7 Feb 2006 02:35:25 -0000	1.13
+++ src/compiler/sparc/vm.lisp	14 Jan 2007 02:49:28 -0000
@@ -124,13 +124,6 @@
       ((null classes)
        (nreverse forms))))
 
-;;; see comment in ../x86/vm.lisp.  The value of 7 was taken from
-;;; vm:catch-block-size in a cmucl that I happened to have around
-;;; and seems to be working so far    -dan
-;;;
-;;; arbitrarily taken for alpha, too. - Christophe
-(def!constant kludge-nondeterministic-catch-block-size 7)
-
 (!define-storage-classes
 
   ;; non-immediate constants in the constant pool
@@ -286,7 +279,7 @@
 
 
   ;; A catch or unwind block.
-  (catch-block control-stack :element-size kludge-nondeterministic-catch-block-size))
+  (catch-block control-stack :element-size catch-block-size))
 
 ;;;; Make some miscellaneous TNs for important registers.
 (macrolet ((defregtn (name sc)
Index: src/compiler/x86/vm.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/x86/vm.lisp,v
retrieving revision 1.25
diff -u -r1.25 vm.lisp
--- src/compiler/x86/vm.lisp	13 Jan 2007 21:05:34 -0000	1.25
+++ src/compiler/x86/vm.lisp	14 Jan 2007 02:49:28 -0000
@@ -141,28 +141,6 @@
     `(progn
        ,@(forms))))
 
-;;; The DEFINE-STORAGE-CLASS call for CATCH-BLOCK refers to the size
-;;; of CATCH-BLOCK. The size of CATCH-BLOCK isn't calculated until
-;;; later in the build process, and the calculation is entangled with
-;;; code which has lots of predependencies, including dependencies on
-;;; the prior call of DEFINE-STORAGE-CLASS. The proper way to
-;;; unscramble this would be to untangle the code, so that the code
-;;; which calculates the size of CATCH-BLOCK can be separated from the
-;;; other lots-of-dependencies code, so that the code which calculates
-;;; the size of CATCH-BLOCK can be executed early, so that this value
-;;; is known properly at this point in compilation. However, that
-;;; would be a lot of editing of code that I (WHN 19990131) can't test
-;;; until the project is complete. So instead, I set the correct value
-;;; by hand here (a sort of nondeterministic guess of the right
-;;; answer:-) and add an assertion later, after the value is
-;;; calculated, that the original guess was correct.
-;;;
-;;; (What a KLUDGE! Anyone who wants to come in and clean up this mess
-;;; has my gratitude.) (FIXME: Maybe this should be me..)
-(eval-when (:compile-toplevel :load-toplevel :execute)
-  (def!constant kludge-nondeterministic-catch-block-size
-      #!-win32 6 #!+win32 8))
-
 (!define-storage-classes
 
   ;; non-immediate constants in the constant pool
@@ -322,7 +300,7 @@
                     :alternate-scs (complex-long-stack))
 
   ;; a catch or unwind block
-  (catch-block stack :element-size kludge-nondeterministic-catch-block-size))
+  (catch-block stack :element-size catch-block-size))
 
 (eval-when (:compile-toplevel :load-toplevel :execute)
 (defparameter *byte-sc-names*
Index: src/compiler/x86-64/vm.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/x86-64/vm.lisp,v
retrieving revision 1.8
diff -u -r1.8 vm.lisp
--- src/compiler/x86-64/vm.lisp	7 Feb 2006 02:35:25 -0000	1.8
+++ src/compiler/x86-64/vm.lisp	14 Jan 2007 02:49:28 -0000
@@ -189,27 +189,6 @@
     `(progn
        ,@(forms))))
 
-;;; The DEFINE-STORAGE-CLASS call for CATCH-BLOCK refers to the size
-;;; of CATCH-BLOCK. The size of CATCH-BLOCK isn't calculated until
-;;; later in the build process, and the calculation is entangled with
-;;; code which has lots of predependencies, including dependencies on
-;;; the prior call of DEFINE-STORAGE-CLASS. The proper way to
-;;; unscramble this would be to untangle the code, so that the code
-;;; which calculates the size of CATCH-BLOCK can be separated from the
-;;; other lots-of-dependencies code, so that the code which calculates
-;;; the size of CATCH-BLOCK can be executed early, so that this value
-;;; is known properly at this point in compilation. However, that
-;;; would be a lot of editing of code that I (WHN 19990131) can't test
-;;; until the project is complete. So instead, I set the correct value
-;;; by hand here (a sort of nondeterministic guess of the right
-;;; answer:-) and add an assertion later, after the value is
-;;; calculated, that the original guess was correct.
-;;;
-;;; (What a KLUDGE! Anyone who wants to come in and clean up this mess
-;;; has my gratitude.) (FIXME: Maybe this should be me..)
-(eval-when (:compile-toplevel :load-toplevel :execute)
-  (def!constant kludge-nondeterministic-catch-block-size 6))
-
 (!define-storage-classes
 
   ;; non-immediate constants in the constant pool
@@ -350,7 +329,7 @@
                       :alternate-scs (complex-double-stack))
 
   ;; a catch or unwind block
-  (catch-block stack :element-size kludge-nondeterministic-catch-block-size))
+  (catch-block stack :element-size catch-block-size))
 
 (eval-when (:compile-toplevel :load-toplevel :execute)
 (defparameter *byte-sc-names*
