;;;; files for more information.
(in-package "SB!VM")
-
-(file-comment
- "$Header$")
\f
;;;; the primitive objects themselves
(define-primitive-object (function :type function
:lowtag function-pointer-type
:header function-header-type)
- #!-gengc (self :ref-trans %function-self :set-trans (setf %function-self))
+ #!-(or gengc x86) (self :ref-trans %function-self
+ :set-trans (setf %function-self))
+ #!+x86 (self
+ ;; KLUDGE: There's no :SET-KNOWN, :SET-TRANS, :REF-KNOWN, or
+ ;; :REF-TRANS here in this case. Instead, there's separate
+ ;; DEFKNOWN/DEFINE-VOP/DEFTRANSFORM stuff in
+ ;; compiler/x86/system.lisp to define and declare them by
+ ;; hand. I don't know why this is, but that's (basically)
+ ;; the way it was done in CMU CL, and it works. (It's not
+ ;; exactly the same way it was done in CMU CL in that CMU
+ ;; CL's allows duplicate DEFKNOWNs, blithely overwriting any
+ ;; previous data associated with the previous DEFKNOWN, and
+ ;; that property was used to mask the definitions here. In
+ ;; SBCL as of 0.6.12.64 that's not allowed -- too confusing!
+ ;; -- so we have to explicitly suppress the DEFKNOWNish
+ ;; stuff here in order to allow this old hack to work in the
+ ;; new world. -- WHN 2001-08-82
+ )
#!+gengc (entry-point :c-type "char *")
(next :type (or function null)
:ref-known (flushable)
:lowtag function-pointer-type
:header funcallable-instance-header-type
:alloc-trans %make-funcallable-instance)
- #!-gengc
+ #!-(or gengc x86)
(function
:ref-known (flushable) :ref-trans %funcallable-instance-function
:set-known (unsafe) :set-trans (setf %funcallable-instance-function))
+ #!+x86
+ (function
+ :ref-known (flushable) :ref-trans %funcallable-instance-function
+ ;; KLUDGE: There's no :SET-KNOWN or :SET-TRANS in this case.
+ ;; Instead, later in compiler/x86/system.lisp there's a separate
+ ;; DEFKNOWN for (SETF %FUNCALLABLE-INSTANCE-FUNCTION), and a weird
+ ;; unexplained DEFTRANSFORM from (SETF %FUNCTION-INSTANCE-FUNCTION)
+ ;; into (SETF %FUNCTION-SELF). The #!+X86 wrapped around this case
+ ;; is a literal translation of the old CMU CL implementation into
+ ;; the new world of sbcl-0.6.12.63, where multiple DEFKNOWNs for
+ ;; the same operator cause an error (instead of silently deleting
+ ;; all information associated with the old DEFKNOWN, as before).
+ ;; It's definitely not very clean, with too many #!+ conditionals,
+ ;; too little documentation, and an implicit assumption that GENGC
+ ;; and X86 are mutually exclusive, but I have more urgent things to
+ ;; clean up right now, so I've just left it as a literal
+ ;; translation without trying to fix it. -- WHN 2001-08-02
+ )
#!+gengc (entry-point :c-type "char *")
(lexenv :ref-known (flushable) :ref-trans %funcallable-instance-lexenv
:set-known (unsafe) :set-trans (setf %funcallable-instance-lexenv))
;;; (For an explanation of this, see the comments at the definition of
;;; KLUDGE-NONDETERMINISTIC-CATCH-BLOCK-SIZE.)
-(assert (= sb!vm::kludge-nondeterministic-catch-block-size catch-block-size))
-
-#!+gengc
-(define-primitive-object (mutator)
- ;; Holds the lisp thread structure, if any.
- (thread)
- ;; Signal control magic.
- (foreign-fn-call-active :c-type "boolean")
- (interrupts-disabled-count :c-type "int")
- (interrupt-pending :c-type "boolean")
- (pending-signal :c-type "int")
- (pending-code :c-type "int")
- (pending-mask :c-type "int")
- (gc-pending :c-type "boolean")
- ;; Stacks.
- (control-stack-base :c-type "lispobj *")
- (control-stack-pointer :c-type "lispobj *")
- (control-stack-end :c-type "lispobj *")
- (control-frame-pointer :c-type "lispobj *")
- (current-unwind-protect :c-type "struct unwind_block *")
- (current-catch-block :c-type "struct catch_block *")
- (binding-stack-base :c-type "struct binding *")
- (binding-stack-pointer :c-type "struct binding *")
- (binding-stack-end :c-type "struct binding *")
- (number-stack-base :c-type "char *")
- (number-stack-pointer :c-type "char *")
- (number-stack-end :c-type "char *")
- (eval-stack)
- (eval-stack-top)
- ;; Allocation stuff.
- (nursery-start :c-type "lispobj *")
- (nursery-fill-pointer :c-type "lispobj *")
- (nursery-end :c-type "lispobj *")
- (storebuf-start :c-type "lispobj **")
- (storebuf-fill-pointer :c-type "lispobj **")
- (storebuf-end :c-type "lispobj **")
- (words-consed :c-type "unsigned long"))
-
+(aver (= sb!vm::kludge-nondeterministic-catch-block-size catch-block-size))
\f
;;;; symbols
(defknown %make-symbol (index simple-string) symbol
(flushable movable))
-#+gengc
+#!+gengc
(defknown symbol-hash (symbol) index
(flushable movable))
-#+x86
+#!+x86
(defknown symbol-hash (symbol) (integer 0 #.*target-most-positive-fixnum*)
(flushable movable))