;;; 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
;;; 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))))
(inst lea ,result-tn
(make-ea :byte :base ,result-tn :disp other-pointer-type))
,@forms))
-
\f
;;;; error code
;;; 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
;; something. (perhaps SVLB, for static variable low byte)
(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.
0)
(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)))
(when *enable-pseudo-atomic*
(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)
(inst cmp (make-ea :byte
:disp (+ nil-value
(static-symbol-offset
- 'sb!impl::*pseudo-atomic-interrupted*)
+ '*pseudo-atomic-interrupted*)
(ash symbol-value-slot word-shift)
(- other-pointer-type)))
0)