X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fgeneric%2Fobjdef.lisp;h=61cfaab1dd666003dce3f556255f8567579dccad;hb=0dcc957ae6bf24809fda82fd59c134e70058c42a;hp=33e9db3b716ca500497b3d50685a35885f1c3a44;hpb=a530bbe337109d898d5b4a001fc8f1afa3b5dc39;p=sbcl.git diff --git a/src/compiler/generic/objdef.lisp b/src/compiler/generic/objdef.lisp index 33e9db3..61cfaab 100644 --- a/src/compiler/generic/objdef.lisp +++ b/src/compiler/generic/objdef.lisp @@ -10,9 +10,6 @@ ;;;; files for more information. (in-package "SB!VM") - -(file-comment - "$Header$") ;;;; the primitive objects themselves @@ -142,7 +139,24 @@ (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) @@ -177,10 +191,28 @@ :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)) @@ -244,44 +276,7 @@ ;;; (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)) ;;;; symbols @@ -289,11 +284,11 @@ (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))