X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fdyncount.lisp;h=76a03997aec45496228cc5e6de7960323c1095ad;hb=0e5e8dc759b478bf9ef55d45d80604c24faea2ae;hp=ffc0aed6c95cf7ca4741a3031a2392ce724dd8e4;hpb=a530bbe337109d898d5b4a001fc8f1afa3b5dc39;p=sbcl.git diff --git a/src/code/dyncount.lisp b/src/code/dyncount.lisp index ffc0aed..76a0399 100644 --- a/src/code/dyncount.lisp +++ b/src/code/dyncount.lisp @@ -11,14 +11,12 @@ (in-package "SB!DYNCOUNT") -(file-comment - "$Header$") - #| -Make sure multi-cycle instruction costs are plausible. -VOP classification. - Make tables of %cost for benchmark X class. - Could be represented as a sort of bar chart. +comments from CMU CL: + Make sure multi-cycle instruction costs are plausible. + VOP classification. + Make tables of %cost for benchmark X class. + Could be represented as a sort of bar chart. |# (eval-when (:compile-toplevel) @@ -100,8 +98,9 @@ VOP classification. (deftype count-vector () '(simple-array double-float (2))) (defstruct (vop-stats (:constructor %make-vop-stats (name)) - (:constructor make-vop-stats-key)) - (name (required-argument) :type simple-string) + (:constructor make-vop-stats-key) + (:copier nil)) + (name (missing-arg) :type simple-string) (data (make-array 2 :element-type 'double-float) :type count-vector)) (defmacro vop-stats-count (x) `(aref (vop-stats-data ,x) 0)) @@ -173,10 +172,10 @@ VOP classification. (without-gcing (dolist (space spaces) (sb!vm::map-allocated-objects - #'(lambda (object type-code size) - (declare (ignore type-code size)) - (when (dyncount-info-p object) - (clear-dyncount-info object))) + (lambda (object type-code size) + (declare (ignore type-code size)) + (when (dyncount-info-p object) + (clear-dyncount-info object))) space))))) ;;; Call NOTE-DYNCOUNT-INFO on all DYNCOUNT-INFO structure allocated in the @@ -187,19 +186,19 @@ VOP classification. #!+sb-doc "Return a hash-table mapping string VOP names to VOP-STATS structures describing the VOPs executed. If clear is true, then reset all counts to - zero as a side-effect." + zero as a side effect." (locally (declare (optimize (speed 3) (safety 0)) (inline sb!vm::map-allocated-objects)) (without-gcing (dolist (space spaces) (sb!vm::map-allocated-objects - #'(lambda (object type-code size) - (declare (ignore type-code size)) - (when (dyncount-info-p object) - (note-dyncount-info object) - (when clear - (clear-dyncount-info object)))) + (lambda (object type-code size) + (declare (ignore type-code size)) + (when (dyncount-info-p object) + (note-dyncount-info object) + (when clear + (clear-dyncount-info object)))) space)))) (let ((counts (make-hash-table :test 'equal))) @@ -215,8 +214,8 @@ VOP classification. ;;; Return the DYNCOUNT-INFO for FUNCTION. (defun find-info-for (function) (declare (type function function)) - (let* ((function (%primitive closure-function function)) - (component (sb!di::function-code-header function))) + (let* ((function (%primitive closure-fun function)) + (component (sb!di::fun-code-header function))) (do ((end (get-header-data component)) (i sb!vm:code-constants-offset (1+ i))) ((= end i)) @@ -233,8 +232,8 @@ VOP classification. (clear-vop-counts spaces) (apply function args) (if by-space - (mapcar #'(lambda (space) - (get-vop-counts (list space) :clear t)) + (mapcar (lambda (space) + (get-vop-counts (list space) :clear t)) spaces) (get-vop-counts spaces))) @@ -274,7 +273,7 @@ VOP classification. ("Simple type predicate" "STRUCTUREP" "LISTP" "FIXNUMP") ("Simple type check" "CHECK-LIST" "CHECK-FIXNUM" "CHECK-STRUCTURE") ("Array bounds check" "CHECK-BOUND") - ("Complex type check" "$CHECK-" "COERCE-TO-FUNCTION") + ("Complex type check" "$CHECK-" "COERCE-TO-FUN") ("Special read" "SYMBOL-VALUE") ("Special bind" "BIND$") ("Tagging" "MOVE-FROM") @@ -287,7 +286,7 @@ VOP classification. ("List/string utility" "LENGTH/LIST" "SXHASH" "BIT-BASH" "$LENGTH$") ("Alien operations" "SAP" "ALLOC-NUMBER-STACK" "$CALL-OUT$") ("Function call/return" "CALL" "RETURN" "ALLOCATE-FRAME" - "COPY-MORE-ARG" "LISTIFY-REST-ARG" "VERIFY-ARGUMENT-COUNT") + "COPY-MORE-ARG" "LISTIFY-REST-ARG" "VERIFY-ARG-COUNT") ("Allocation" "MAKE-" "ALLOC" "$CONS$" "$LIST$" "$LIST*$") ("Float conversion" "%SINGLE-FLOAT" "%DOUBLE-FLOAT" "-BITS$") ("Complex type predicate" "P$"))) @@ -404,10 +403,10 @@ VOP classification. (defun sort-result (table by) (sort (hash-list table) #'> - :key #'(lambda (x) - (abs (ecase by - (:count (vop-stats-count x)) - (:cost (vop-stats-cost x))))))) + :key (lambda (x) + (abs (ecase by + (:count (vop-stats-count x)) + (:cost (vop-stats-cost x))))))) ;;; Report about VOPs in the list of stats structures. (defun entry-report (entries cut-off compensated compare total-cost) @@ -431,7 +430,7 @@ VOP classification. cost) total-cost)) (when (zerop (decf counter)) - (format t "[End of top ~D]~%" cut-off)))))) + (format t "[End of top ~W]~%" cut-off)))))) ;;; Divide SORTED into two lists, the first CUT-OFF elements long. Any VOP ;;; names that match one of the report strings are moved into the REPORT list @@ -533,7 +532,6 @@ VOP classification. (compared (if compare (compare-stats compensated compare) compensated)) - (*gc-verbose* nil) (*gc-notify-stream* nil)) (multiple-value-bind (total-count total-cost) (cost-summary compensated) (multiple-value-bind (compare-total-count compare-total-cost)