1.0.12.5: WITH-ARRAY-DATA touchups
[sbcl.git] / src / code / array.lisp
index 45c15a5..3a9d703 100644 (file)
            (fixnum index))
   (%check-bound array bound index))
 
+(defun %with-array-data/fp (array start end)
+  (%with-array-data-macro array start end :check-bounds t :check-fill-pointer t))
+
 (defun %with-array-data (array start end)
-  (%with-array-data-macro array start end :fail-inline? t))
+  (%with-array-data-macro array start end :check-bounds t :check-fill-pointer nil))
 
 (defun %data-vector-and-index (array index)
   (if (array-header-p array)
           (%with-array-data array index nil)
         (values vector index))
       (values array index)))
-
-;;; It'd waste space to expand copies of error handling in every
-;;; inline %WITH-ARRAY-DATA, so we have them call this function
-;;; instead. This is just a wrapper which is known never to return.
-(defun failed-%with-array-data (array start end)
-  (declare (notinline %with-array-data))
-  (%with-array-data array start end)
-  (bug "called FAILED-%WITH-ARRAY-DATA with valid array parameters?"))
 \f
 ;;;; MAKE-ARRAY
 (eval-when (:compile-toplevel :execute)
@@ -337,11 +332,7 @@ of specialized arrays is supported."
                             (:little-endian
                              (- sb!vm:other-pointer-lowtag))
                             (:big-endian
-                             ;; I'm not completely sure of what this
-                             ;; 3 represents symbolically. It's
-                             ;; just what all the LOAD-TYPE vops
-                             ;; are doing.
-                             (- 3 sb!vm:other-pointer-lowtag)))))
+                             (- (1- sb!vm:n-word-bytes) sb!vm:other-pointer-lowtag)))))
                    ;; WIDETAG-OF needs extra code to handle
                    ;; LIST and FUNCTION lowtags. We're only
                    ;; dispatching on other pointers, so let's
@@ -473,6 +464,9 @@ of specialized arrays is supported."
 (defun data-vector-ref (array index)
   (hairy-data-vector-ref array index))
 
+(defun data-vector-ref-with-offset (array index offset)
+  (hairy-data-vector-ref array (+ index offset)))
+
 ;;; SUBSCRIPTS has a dynamic-extent list structure and is destroyed
 (defun %array-row-major-index (array subscripts
                                      &optional (invalid-index-error-p t))