mirror of
git://git.code.sf.net/p/sbcl/sbcl
synced 2026-09-10 07:26:40 -04:00
Also explicitly block compile the two files it was used for. Block compilation accomplishes the same thing and handles more cases, as top level ir1 converted lambdas can be delayed arbitrarily in a file, unlike forms. All the type tests that should be open-coded, are, (the build would warn otherwise), but the cross-typep ambiguity stuff needs to be disabled during cross compile, since there is no way to know a priori whether a forward referenced type will get resolved later.
17 lines
960 B
Common Lisp
17 lines
960 B
Common Lisp
;;; Prior to the change that allowed forward-references to slot types,
|
|
;;; the MAKE-S1 constructor would have used a "cached typep" placeholder
|
|
;;; for structure types S2 and S3; and MAKE-S2 would have used one for S3.
|
|
;;; The placeholder lazily figures out that a symbol references a now-defined
|
|
;;; defstruct, and it tries to precompute a way to as-efficiently-as-possible
|
|
;;; test for that type, given that it couldn't wire in the test to start with.
|
|
;;; Only S3 would have been compiled correctly from the outset because it
|
|
;;; makes backwards references and no forward references.
|
|
;;;
|
|
;;; But now with the DEFSTRUCT improvements, the type checks for the slot
|
|
;;; named A all compile to basically the same thing in each MAKE- function,
|
|
;;; without use of placeholders nor just-in-time optimization attempts.
|
|
;;;
|
|
(defstruct s1 (a nil :type (or s1 s2 s3 null)))
|
|
(defstruct s2 (a nil :type (or s1 s2 s3 null)))
|
|
(defstruct s3 (a nil :type (or s1 s2 s3 null)))
|