X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fmips%2Falloc.lisp;h=7b0c3433eba2fe1187d21e7c82d03364de1b10a1;hb=5d04a95274c9ddaebbcd6ddffc5d646e2c25598c;hp=697ba4c3269015857acb813baad26aaf31759408;hpb=481348f2f96f364374f669786f9fc61348decabc;p=sbcl.git diff --git a/src/compiler/mips/alloc.lisp b/src/compiler/mips/alloc.lisp index 697ba4c..7b0c343 100644 --- a/src/compiler/mips/alloc.lisp +++ b/src/compiler/mips/alloc.lisp @@ -10,9 +10,12 @@ ;;;; files for more information. (in-package "SB!VM") - ;;;; LIST and LIST* +(defoptimizer (list stack-allocate-result) ((&rest args)) + (not (null args))) +(defoptimizer (list* stack-allocate-result) ((&rest args)) + (not (null (rest args)))) (define-vop (list-or-list*) (:args (things :more t)) @@ -25,6 +28,7 @@ (:results (result :scs (descriptor-reg))) (:variant-vars star) (:policy :safe) + (:node-var node) (:generator 0 (cond ((zerop num) (move result null-tn)) @@ -35,18 +39,23 @@ ((store-car (tn list &optional (slot cons-car-slot)) `(let ((reg (sc-case ,tn - ((any-reg descriptor-reg) ,tn) - (zero zero-tn) - (null null-tn) + ((any-reg descriptor-reg zero null) + ,tn) (control-stack (load-stack-tn temp ,tn) temp)))) (storew reg ,list ,slot list-pointer-lowtag)))) - (let ((cons-cells (if star (1- num) num))) - (pseudo-atomic (pa-flag - :extra (* (pad-data-block cons-size) - cons-cells)) - (inst or res alloc-tn list-pointer-lowtag) + (let* ((dx-p (node-stack-allocate-p node)) + (cons-cells (if star (1- num) num)) + (alloc (* (pad-data-block cons-size) cons-cells))) + (pseudo-atomic (pa-flag :extra (if dx-p 0 alloc)) + (when dx-p + (align-csp res)) + (inst srl res (if dx-p csp-tn alloc-tn) n-lowtag-bits) + (inst sll res n-lowtag-bits) + (inst or res list-pointer-lowtag) + (when dx-p + (inst addu csp-tn alloc)) (move ptr res) (dotimes (i (1- cons-cells)) (store-car (tn-ref-tn things) ptr) @@ -70,7 +79,6 @@ (define-vop (list* list-or-list*) (:variant t)) - ;;;; Special purpose inline allocators. @@ -95,13 +103,12 @@ (pseudo-atomic (pa-flag) (inst or result alloc-tn other-pointer-lowtag) + (inst addu alloc-tn boxed) (storew ndescr result 0 other-pointer-lowtag) (storew unboxed result code-code-size-slot other-pointer-lowtag) + (inst addu alloc-tn unboxed) (storew null-tn result code-entry-points-slot other-pointer-lowtag) - (inst addu alloc-tn boxed) - (inst addu alloc-tn unboxed)) - - (storew null-tn result code-debug-info-slot other-pointer-lowtag))) + (storew null-tn result code-debug-info-slot other-pointer-lowtag)))) (define-vop (make-fdefn) (:policy :fast-safe) @@ -111,7 +118,7 @@ (:temporary (:sc non-descriptor-reg :offset nl4-offset) pa-flag) (:results (result :scs (descriptor-reg) :from :argument)) (:generator 37 - (with-fixed-allocation (result pa-flag temp fdefn-widetag fdefn-size) + (with-fixed-allocation (result pa-flag temp fdefn-widetag fdefn-size nil) (inst li temp (make-fixup "undefined_tramp" :foreign)) (storew name result fdefn-name-slot other-pointer-lowtag) (storew null-tn result fdefn-fun-slot other-pointer-lowtag) @@ -137,21 +144,20 @@ (inst or result fun-pointer-lowtag) (inst li temp (logior (ash (1- size) n-widetag-bits) closure-header-widetag)) - (storew temp result 0 fun-pointer-lowtag)) - (storew result result closure-self-slot fun-pointer-lowtag) - (storew function result closure-fun-slot fun-pointer-lowtag)))) + (storew temp result 0 fun-pointer-lowtag) + (storew function result closure-fun-slot fun-pointer-lowtag))))) ;;; The compiler likes to be able to directly make value cells. -;;; (define-vop (make-value-cell) (:args (value :to :save :scs (descriptor-reg any-reg null zero))) (:temporary (:scs (non-descriptor-reg)) temp) (:temporary (:sc non-descriptor-reg :offset nl4-offset) pa-flag) + (:info stack-allocate-p) (:results (result :scs (descriptor-reg))) (:generator 10 - (with-fixed-allocation (result pa-flag temp value-cell-header-widetag value-cell-size) + (with-fixed-allocation (result pa-flag temp value-cell-header-widetag + value-cell-size stack-allocate-p) (storew value result value-cell-value-slot other-pointer-lowtag)))) - ;;;; Automatic allocators for primitive objects. @@ -161,10 +167,16 @@ (:generator 1 (inst li result unbound-marker-widetag))) +(define-vop (make-funcallable-instance-tramp) + (:args) + (:results (result :scs (any-reg))) + (:generator 1 + (inst li result (make-fixup "funcallable_instance_tramp" :foreign)))) + (define-vop (fixed-alloc) (:args) - (:info name words type lowtag) - (:ignore name) + (:info name words type lowtag stack-allocate-p) + (:ignore name stack-allocate-p) (:results (result :scs (descriptor-reg))) (:temporary (:scs (non-descriptor-reg)) temp) (:temporary (:sc non-descriptor-reg :offset nl4-offset) pa-flag)