X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fdebug-dump.lisp;h=19f6a0f74bfd8e4a8c5252ee8900890bd3629654;hb=b0642df835dc2fca3e4cf47aff978ecdc88799d5;hp=8e264a92df316d801cf58600b2e63ccd7a99c546;hpb=b0b168c08b31a748150f404398af754f26fd4813;p=sbcl.git diff --git a/src/compiler/debug-dump.lisp b/src/compiler/debug-dump.lisp index 8e264a9..19f6a0f 100644 --- a/src/compiler/debug-dump.lisp +++ b/src/compiler/debug-dump.lisp @@ -240,7 +240,7 @@ ;;; Return a list of DEBUG-SOURCE structures containing information ;;; derived from INFO. Unless :BYTE-COMPILE T was specified, we always -;;; dump the Start-Positions, since it is too hard figure out whether +;;; dump the START-POSITIONS, since it is too hard figure out whether ;;; we need them or not. (defun debug-source-for-info (info) (declare (type source-info info)) @@ -277,7 +277,8 @@ ;;; a vector whose element size is an integer multiple of output byte ;;; size. (defun coerce-to-smallest-eltype (seq) - (let ((maxoid #-sb-xc-host 0 + (let ((maxoid ;; It's probably better to avoid (UNSIGNED-BYTE 0). + #-sb-xc-host 1 ;; An initial value of 255 prevents us from ;; specializing the array to anything smaller than ;; (UNSIGNED-BYTE 8), which keeps the cross-compiler's @@ -294,7 +295,17 @@ (frob i)) (dovector (i seq) (frob i))) - (coerce seq `(simple-array (integer 0 ,maxoid) (*)))))) + (let ((specializer `(unsigned-byte ,(integer-length maxoid)))) + ;; cross-compilers beware! It would be possible for the + ;; upgraded-array-element-type of (UNSIGNED-BYTE 15) to be + ;; (SIGNED-BYTE 16), and this is completely valid by + ;; ANSI. However, the cross-compiler doesn't know how to dump + ;; SIGNED-BYTE arrays, so better make it break now if it ever + ;; will: + #+sb-xc-host + (aver (subtypep (upgraded-array-element-type specializer) + 'unsigned-byte)) + (coerce seq `(simple-array ,specializer (*))))))) ;;;; variables @@ -417,14 +428,14 @@ ;;;; arguments/returns -;;; Return a vector to be used as the -;;; COMPILED-DEBUG-FUN-ARGUMENTS for Fun. If fun is the -;;; MAIN-ENTRY for an optional dispatch, then look at the ARGLIST to -;;; determine the syntax, otherwise pretend all arguments are fixed. +;;; Return a vector to be used as the COMPILED-DEBUG-FUN-ARGS for FUN. +;;; If FUN is the MAIN-ENTRY for an optional dispatch, then look at +;;; the ARGLIST to determine the syntax, otherwise pretend all +;;; arguments are fixed. ;;; ;;; ### This assumption breaks down in EPs other than the main-entry, ;;; since they may or may not have supplied-p vars, etc. -(defun compute-arguments (fun var-locs) +(defun compute-args (fun var-locs) (declare (type clambda fun) (type hash-table var-locs)) (collect ((res)) (let ((od (lambda-optional-dispatch fun))) @@ -505,7 +516,7 @@ (setf (compiled-debug-fun-vars dfun) (compute-vars fun level var-locs)) (setf (compiled-debug-fun-arguments dfun) - (compute-arguments fun var-locs)))) + (compute-args fun var-locs)))) (when (>= level 2) (multiple-value-bind (blocks tlf-num) (compute-debug-blocks fun var-locs)