X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Farray.lisp;h=4a9e054db00eb35ff33957f712a71739be626ba1;hb=7be799a096f8be64365dfd5b566f667f9ea0314a;hp=4cd1b086350bed5efc055ffa5b49dec2832764e4;hpb=79a8e51bf4b06a5bd57bc90233605f98fee3b041;p=sbcl.git diff --git a/src/code/array.lisp b/src/code/array.lisp index 4cd1b08..4a9e054 100644 --- a/src/code/array.lisp +++ b/src/code/array.lisp @@ -328,17 +328,17 @@ of specialized arrays is supported." ;;; vectors or not simple. (macrolet ((def (name table-name) `(progn - (defglobal ,table-name (make-array ,sb!vm:widetag-mask)) + (defglobal ,table-name (make-array ,(1+ sb!vm:widetag-mask))) (defmacro ,name (array-var) `(the function (let ((tag 0)) (when (sb!vm::%other-pointer-p ,array-var) (setf tag (%other-pointer-widetag ,array-var))) (svref ,',table-name tag))))))) - (def !find-data-vector-setter **data-vector-setters**) - (def !find-data-vector-setter/check-bounds **data-vector-setters/check-bounds**) - (def !find-data-vector-reffer **data-vector-reffers**) - (def !find-data-vector-reffer/check-bounds **data-vector-reffers/check-bounds**)) + (def !find-data-vector-setter %%data-vector-setters%%) + (def !find-data-vector-setter/check-bounds %%data-vector-setters/check-bounds%%) + (def !find-data-vector-reffer %%data-vector-reffers%%) + (def !find-data-vector-reffer/check-bounds %%data-vector-reffers/check-bounds%%)) (macrolet ((%ref (accessor-getter extra-params) `(funcall (,accessor-getter array) array index ,@extra-params)) @@ -428,7 +428,10 @@ of specialized arrays is supported." new-value))) (define-reffers (symbol deffer check-form slow-path) `(progn - (setf ,symbol (make-array sb!vm::widetag-mask + ;; FIXME/KLUDGE: can't just FILL here, because genesis doesn't + ;; preserve the binding, so re-initiaize as NS doesn't have + ;; the energy to figure out to change that right now. + (setf ,symbol (make-array (1+ sb!vm::widetag-mask) :initial-element #'hairy-ref-error)) ,@(loop for widetag in '(sb!vm:complex-vector-widetag sb!vm:complex-vector-nil-widetag @@ -443,16 +446,16 @@ of specialized arrays is supported." collect `(setf (svref ,symbol ,widetag) (,deffer ,saetp ,check-form)))))) (defun !hairy-data-vector-reffer-init () - (define-reffers **data-vector-reffers** define-reffer + (define-reffers %%data-vector-reffers%% define-reffer (progn) #'slow-hairy-data-vector-ref) - (define-reffers **data-vector-setters** define-setter + (define-reffers %%data-vector-setters%% define-setter (progn) #'slow-hairy-data-vector-set) - (define-reffers **data-vector-reffers/check-bounds** define-reffer + (define-reffers %%data-vector-reffers/check-bounds%% define-reffer (%check-bound vector (length vector)) #'slow-hairy-data-vector-ref/check-bounds) - (define-reffers **data-vector-setters/check-bounds** define-setter + (define-reffers %%data-vector-setters/check-bounds%% define-setter (%check-bound vector (length vector)) #'slow-hairy-data-vector-set/check-bounds))) @@ -528,7 +531,7 @@ of specialized arrays is supported." (defun array-in-bounds-p (array &rest subscripts) #!+sb-doc - "Return T if the SUBSCIPTS are in bounds for the ARRAY, NIL otherwise." + "Return T if the SUBSCRIPTS are in bounds for the ARRAY, NIL otherwise." (if (%array-row-major-index array subscripts nil) t))