Skip to content

Commit

Permalink
0.9.0.22: more fixed allocation
Browse files Browse the repository at this point in the history
 * fix remaining WITH-FIXED-ALLOCATIONS with empty bodies. NB: there
    seems to be some doubt whether this is actually the right thing to
    do, as CMUCL has at least in sparc/float.lisp in MOVE-FOO-FLOAT a
    commit message by William Lott indicating that this was
    intentional "to avoid handling a trap within P-A". Which trap that
    would be is unclear, but hopefully we will eventually rediscover
    the cases where this is intentional.
 * make WITH-FIXED-ALLOCATION signal a BUG if body is empty to catch
    this in the future.
 * sprinkle WITH-FIXED-ALLOCATION with FAIRY-D^WONCE-ONLY on platforms
    that didn't have it yet.
  • Loading branch information
nikodemus committed May 6, 2005
1 parent 35697e2 commit f4b46d1
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 34 deletions.
13 changes: 8 additions & 5 deletions src/compiler/alpha/macros.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,14 @@
;;; presumably initializes the object.
(defmacro with-fixed-allocation ((result-tn temp-tn widetag size)
&body body)
`(pseudo-atomic (:extra (pad-data-block ,size))
(inst bis alloc-tn other-pointer-lowtag ,result-tn)
(inst li (logior (ash (1- ,size) n-widetag-bits) ,widetag) ,temp-tn)
(storew ,temp-tn ,result-tn 0 other-pointer-lowtag)
,@body))
(unless body
(bug "empty &body in WITH-FIXED-ALLOCATION"))
(once-only ((result-tn result-tn) (temp-tn temp-tn) (size size))
`(pseudo-atomic (:extra (pad-data-block ,size))
(inst bis alloc-tn other-pointer-lowtag ,result-tn)
(inst li (logior (ash (1- ,size) n-widetag-bits) ,widetag) ,temp-tn)
(storew ,temp-tn ,result-tn 0 other-pointer-lowtag)
,@body)))

;;;; error code
(eval-when (:compile-toplevel :load-toplevel :execute)
Expand Down
2 changes: 2 additions & 0 deletions src/compiler/hppa/macros.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@
Result-TN, and Temp-TN is a non-descriptor temp (which may be randomly used
by the body.) The body is placed inside the PSEUDO-ATOMIC, and presumably
initializes the object."
(unless body
(bug "empty &body in WITH-FIXED-ALLOCATION"))
(once-only ((result-tn result-tn) (temp-tn temp-tn)
(type-code type-code) (size size))
`(pseudo-atomic (:extra (pad-data-block ,size))
Expand Down
5 changes: 2 additions & 3 deletions src/compiler/mips/alloc.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,8 @@
(:temporary (:sc non-descriptor-reg :offset nl4-offset) pa-flag)
(:results (result :scs (descriptor-reg)))
(:generator 10
(with-fixed-allocation
(result pa-flag temp value-cell-header-widetag value-cell-size))
(storew value result value-cell-value-slot other-pointer-lowtag)))
(with-fixed-allocation (result pa-flag temp value-cell-header-widetag value-cell-size)
(storew value result value-cell-value-slot other-pointer-lowtag))))


;;;; Automatic allocators for primitive objects.
Expand Down
14 changes: 8 additions & 6 deletions src/compiler/mips/macros.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,14 @@
Result-TN, Flag-Tn must be wired to NL4-OFFSET, and Temp-TN is a non-
descriptor temp (which may be randomly used by the body.) The body is
placed inside the PSEUDO-ATOMIC, and presumably initializes the object."
`(pseudo-atomic (,flag-tn :extra (pad-data-block ,size))
(inst or ,result-tn alloc-tn other-pointer-lowtag)
(inst li ,temp-tn (logior (ash (1- ,size) n-widetag-bits) ,type-code))
(storew ,temp-tn ,result-tn 0 other-pointer-lowtag)
,@body))

(unless body
(bug "empty &body in WITH-FIXED-ALLOCATION"))
(once-only ((result-tn result-tn) (temp-tn temp-tn) (size size))
`(pseudo-atomic (,flag-tn :extra (pad-data-block ,size))
(inst or ,result-tn alloc-tn other-pointer-lowtag)
(inst li ,temp-tn (logior (ash (1- ,size) n-widetag-bits) ,type-code))
(storew ,temp-tn ,result-tn 0 other-pointer-lowtag)
,@body)))


;;;; Three Way Comparison
Expand Down
5 changes: 2 additions & 3 deletions src/compiler/ppc/alloc.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,8 @@
(:temporary (:sc non-descriptor-reg :offset nl3-offset) pa-flag)
(:results (result :scs (descriptor-reg)))
(:generator 10
(with-fixed-allocation
(result pa-flag temp value-cell-header-widetag value-cell-size))
(storew value result value-cell-value-slot other-pointer-lowtag)))
(with-fixed-allocation (result pa-flag temp value-cell-header-widetag value-cell-size)
(storew value result value-cell-value-slot other-pointer-lowtag))))



Expand Down
2 changes: 2 additions & 0 deletions src/compiler/ppc/macros.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@
Result-TN, and Temp-TN is a non-descriptor temp (which may be randomly used
by the body.) The body is placed inside the PSEUDO-ATOMIC, and presumably
initializes the object."
(unless body
(bug "empty &body in WITH-FIXED-ALLOCATION"))
(once-only ((result-tn result-tn) (temp-tn temp-tn) (flag-tn flag-tn)
(type-code type-code) (size size))
`(pseudo-atomic (,flag-tn :extra (pad-data-block ,size))
Expand Down
2 changes: 2 additions & 0 deletions src/compiler/sparc/macros.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@
Result-TN, and Temp-TN is a non-descriptor temp (which may be randomly used
by the body.) The body is placed inside the PSEUDO-ATOMIC, and presumably
initializes the object."
(unless body
(bug "empty &body in WITH-FIXED-ALLOCATION"))
(once-only ((result-tn result-tn) (temp-tn temp-tn)
(type-code type-code) (size size))
`(pseudo-atomic (:extra (pad-data-block ,size))
Expand Down
19 changes: 11 additions & 8 deletions src/compiler/x86-64/macros.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,17 @@
;;; header having the specified WIDETAG value. The result is placed in
;;; RESULT-TN.
(defmacro with-fixed-allocation ((result-tn widetag size &optional inline)
&rest forms)
`(pseudo-atomic
(allocation ,result-tn (pad-data-block ,size) ,inline)
(storew (logior (ash (1- ,size) n-widetag-bits) ,widetag)
,result-tn)
(inst lea ,result-tn
(make-ea :qword :base ,result-tn :disp other-pointer-lowtag))
,@forms))
&body forms)
(unless forms
(bug "empty &body in WITH-FIXED-ALLOCATION"))
(once-only ((result-tn result-tn) (size size))
`(pseudo-atomic
(allocation ,result-tn (pad-data-block ,size) ,inline)
(storew (logior (ash (1- ,size) n-widetag-bits) ,widetag)
,result-tn)
(inst lea ,result-tn
(make-ea :qword :base ,result-tn :disp other-pointer-lowtag))
,@forms)))

;;;; error code
(eval-when (#-sb-xc :compile-toplevel :load-toplevel :execute)
Expand Down
19 changes: 11 additions & 8 deletions src/compiler/x86/macros.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,17 @@
;;; header having the specified WIDETAG value. The result is placed in
;;; RESULT-TN.
(defmacro with-fixed-allocation ((result-tn widetag size &optional inline)
&rest forms)
`(pseudo-atomic
(allocation ,result-tn (pad-data-block ,size) ,inline)
(storew (logior (ash (1- ,size) n-widetag-bits) ,widetag)
,result-tn)
(inst lea ,result-tn
(make-ea :byte :base ,result-tn :disp other-pointer-lowtag))
,@forms))
&body forms)
(unless forms
(bug "empty &body in WITH-FIXED-ALLOCATION"))
(once-only ((result-tn result-tn) (size size))
`(pseudo-atomic
(allocation ,result-tn (pad-data-block ,size) ,inline)
(storew (logior (ash (1- ,size) n-widetag-bits) ,widetag)
,result-tn)
(inst lea ,result-tn
(make-ea :byte :base ,result-tn :disp other-pointer-lowtag))
,@forms)))

;;;; error code
(eval-when (#-sb-xc :compile-toplevel :load-toplevel :execute)
Expand Down
2 changes: 1 addition & 1 deletion version.lisp-expr
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
"0.9.0.21"
"0.9.0.22"

0 comments on commit f4b46d1

Please sign in to comment.