X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Froom.lisp;h=6102f23e4ccace44e705ce44d76ad0abdd24c852;hb=17ae4361ba5f4c1062d510f3951b0cc10e0bcd8e;hp=c957c8d0c5edd3240c93d01528c9722b9b622f3f;hpb=70769503c505c22bddef3bc7885b91b9d503607f;p=sbcl.git diff --git a/src/code/room.lisp b/src/code/room.lisp index c957c8d..6102f23 100644 --- a/src/code/room.lisp +++ b/src/code/room.lisp @@ -193,34 +193,26 @@ (ecase (room-info-kind info) (:vector 0) (:string 1))))) - (declare (type (integer -3 3) shift)) (round-to-dualword (+ (* vector-data-offset n-word-bytes) - (the fixnum - (if (minusp shift) - (ash (the fixnum - (+ len (the fixnum - (1- (the fixnum (ash 1 (- shift))))))) - shift) - (ash len shift))))))) + (if (minusp shift) + (ash (+ len (1- (ash 1 (- shift)))) + shift) + (ash len shift)))))) ;;; Access to the GENCGC page table for better precision in ;;; MAP-ALLOCATED-OBJECTS #!+gencgc (progn - (define-alien-type nil + (define-alien-type (struct page) (struct page - (flags unsigned-int) - (gen int) - (bytes-used int) - (start long))) + (start long) + (bytes-used (unsigned 16)) + (flags (unsigned 8)) + (gen (signed 8)))) (declaim (inline find-page-index)) (define-alien-routine "find_page_index" long (index long)) - (define-alien-variable "page_table" - (array (struct page) - #.(truncate (- dynamic-space-end - dynamic-space-start) - sb!vm:gencgc-page-size)))) + (define-alien-variable "page_table" (* (struct page)))) ;;; Iterate over all the objects allocated in SPACE, calling FUN with ;;; the object, the object's type code, and the object's total size in @@ -231,9 +223,9 @@ (without-gcing (multiple-value-bind (start end) (space-bounds space) (declare (type system-area-pointer start end)) - (declare (optimize (speed 3) (safety 0))) + (declare (optimize (speed 3))) (let ((current start) - (skip-tests-until-addr 0)) + #!+gencgc (skip-tests-until-addr 0)) (labels ((maybe-finish-mapping () (unless (sap< current end) (aver (sap= current end)) @@ -265,7 +257,7 @@ ;; bitfields? (let ((alloc-flag (ldb (byte 3 2) (slot page 'flags))) - (bytes-used (slot page 'bytes-used))) + (bytes-used (slot page 'bytes-used))) ;; If the page is not free and the current ;; pointer is still below the allocation offset ;; of the page @@ -355,7 +347,7 @@ (counts (make-array 256 :initial-element 0 :element-type 'fixnum))) (map-allocated-objects (lambda (obj type size) - (declare (fixnum size) (optimize (speed 3) (safety 0)) (ignore obj)) + (declare (fixnum size) (optimize (speed 3)) (ignore obj)) (incf (aref sizes type) size) (incf (aref counts type))) space) @@ -494,7 +486,7 @@ (type unsigned-byte total-bytes)) (map-allocated-objects (lambda (obj type size) - (declare (fixnum size) (optimize (safety 0))) + (declare (fixnum size)) (when (eql type code-header-widetag) (incf total-bytes size) (let ((words (truly-the fixnum (%code-code-size obj))) @@ -523,7 +515,7 @@ (declare (inline map-allocated-objects)) (map-allocated-objects (lambda (obj type size) - (declare (fixnum size) (optimize (safety 0))) + (declare (fixnum size)) (case type (#.code-header-widetag (let ((inst-words (truly-the fixnum (%code-code-size obj)))) @@ -593,7 +585,7 @@ (declare (fixnum total-objects total-bytes)) (map-allocated-objects (lambda (obj type size) - (declare (fixnum size) (optimize (speed 3) (safety 0))) + (declare (fixnum size) (optimize (speed 3))) (when (eql type instance-header-widetag) (incf total-objects) (incf total-bytes size) @@ -664,7 +656,6 @@ (note-conses (cdr x))))) (map-allocated-objects (lambda (obj obj-type size) - (declare (optimize (safety 0))) (let ((addr (get-lisp-obj-address obj))) (when (>= addr start) (when (if count @@ -745,7 +736,6 @@ (let ((res ())) (map-allocated-objects (lambda (obj obj-type size) - (declare (optimize (safety 0))) (when (and (or (not type) (eql obj-type type)) (or (not smaller) (<= size smaller)) (or (not larger) (>= size larger)) @@ -765,7 +755,7 @@ (funcall fun obj)))) (map-allocated-objects (lambda (obj obj-type size) - (declare (optimize (safety 0)) (ignore obj-type size)) + (declare (ignore obj-type size)) (typecase obj (cons (when (or (eq (car obj) object)