X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86%2Fmacros.lisp;h=b82ca88006f525d3a05de4f6c33e67ec04030aaa;hb=b5703d98da9ebfd688c87e14862ab4e26dc94d14;hp=39d1f1639142d1ebc823f8d0c699aa800eb308bd;hpb=a530bbe337109d898d5b4a001fc8f1afa3b5dc39;p=sbcl.git diff --git a/src/compiler/x86/macros.lisp b/src/compiler/x86/macros.lisp index 39d1f16..b82ca88 100644 --- a/src/compiler/x86/macros.lisp +++ b/src/compiler/x86/macros.lisp @@ -11,9 +11,6 @@ (in-package "SB!VM") -(file-comment - "$Header$") - ;;; We can load/store into fp registers through the top of ;;; stack %st(0) (fr0 here). Loads imply a push to an empty register ;;; which then changes all the reg numbers. These macros help manage that. @@ -68,12 +65,12 @@ ;;;; macros to generate useful values (defmacro load-symbol (reg symbol) - `(inst mov ,reg (+ *nil-value* (static-symbol-offset ,symbol)))) + `(inst mov ,reg (+ nil-value (static-symbol-offset ,symbol)))) (defmacro load-symbol-value (reg symbol) `(inst mov ,reg (make-ea :dword - :disp (+ *nil-value* + :disp (+ nil-value (static-symbol-offset ',symbol) (ash symbol-value-slot word-shift) (- other-pointer-type))))) @@ -81,7 +78,7 @@ (defmacro store-symbol-value (reg symbol) `(inst mov (make-ea :dword - :disp (+ *nil-value* + :disp (+ nil-value (static-symbol-offset ',symbol) (ash symbol-value-slot word-shift) (- other-pointer-type))) @@ -125,9 +122,12 @@ ;;; on DYNAMIC-EXTENT would probably give a better payoff.) (defvar *maybe-use-inline-allocation* t) -;;; Call into C. +;;; Emit code to allocate an object with a size in bytes given by +;;; Size. The size may be an integer of a TN. If Inline is a VOP +;;; node-var then it is used to make an appropriate speed vs size +;;; decision. ;;; -;;; FIXME: Except when inline allocation is enabled..? +;;; FIXME: We call into C.. except when inline allocation is enabled..? ;;; ;;; FIXME: Also, calls to ;;; ALLOCATION are always wrapped with PSEUDO-ATOMIC -- why? Is it to @@ -141,11 +141,6 @@ ;;; formalized, in documentation and in macro definition, ;;; with the macro becoming e.g. PSEUDO-ATOMIC-ALLOCATION. (defun allocation (alloc-tn size &optional inline) - #!+sb-doc - "Emit code to allocate an object with a size in bytes given by Size. - The size may be an integer of a TN. - If Inline is a VOP node-var then it is used to make an appropriate - speed vs size decision." (flet ((load-size (dst-tn size) (unless (and (tn-p size) (location= alloc-tn size)) (inst mov dst-tn size)))) @@ -274,7 +269,6 @@ (inst lea ,result-tn (make-ea :byte :base ,result-tn :disp other-pointer-type)) ,@forms)) - ;;;; error code @@ -373,9 +367,6 @@ ;;; something to compile with :SB-NO-PSEUDO-ATOMIC. (defvar *enable-pseudo-atomic* t) -;;; FIXME: *PSEUDO-ATOMIC-ATOMIC* and *PSEUDO-ATOMIC-INTERRUPTED* -;;; should be in package SB!VM or SB!KERNEL, not SB!IMPL. - ;;; FIXME: *PSEUDO-ATOMIC-FOO* could be made into *PSEUDO-ATOMIC-BITS*, ;;; set with a single operation and cleared with SHR *PSEUDO-ATOMIC-BITS*,-2; ;;; the ATOMIC bit is bit 0, the INTERRUPTED bit is bit 1, and you check @@ -389,25 +380,25 @@ (when *enable-pseudo-atomic* ;; FIXME: The MAKE-EA noise should become a MACROLET macro or ;; something. (perhaps SVLB, for static variable low byte) - (inst mov (make-ea :byte :disp (+ *nil-value* + (inst mov (make-ea :byte :disp (+ nil-value (static-symbol-offset - 'sb!impl::*pseudo-atomic-interrupted*) + '*pseudo-atomic-interrupted*) (ash symbol-value-slot word-shift) ;; FIXME: Use mask, not minus, to ;; take out type bits. (- other-pointer-type))) 0) - (inst mov (make-ea :byte :disp (+ *nil-value* + (inst mov (make-ea :byte :disp (+ nil-value (static-symbol-offset - 'sb!impl::*pseudo-atomic-atomic*) + '*pseudo-atomic-atomic*) (ash symbol-value-slot word-shift) (- other-pointer-type))) (fixnumize 1))) ,@forms (when *enable-pseudo-atomic* - (inst mov (make-ea :byte :disp (+ *nil-value* + (inst mov (make-ea :byte :disp (+ nil-value (static-symbol-offset - 'sb!impl::*pseudo-atomic-atomic*) + '*pseudo-atomic-atomic*) (ash symbol-value-slot word-shift) (- other-pointer-type))) 0) @@ -418,9 +409,9 @@ ;; are pending? I wish I could find the documentation for ;; pseudo-atomics.. -- WHN 19991130 (inst cmp (make-ea :byte - :disp (+ *nil-value* + :disp (+ nil-value (static-symbol-offset - 'sb!impl::*pseudo-atomic-interrupted*) + '*pseudo-atomic-interrupted*) (ash symbol-value-slot word-shift) (- other-pointer-type))) 0)