Changeset 5226


Ignore:
Timestamp:
Sep 20, 2006, 3:15:42 AM (18 years ago)
Author:
Gary Byers
Message:

Numerous changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/level-1/l1-streams.lisp

    r5212 r5226  
    372372  (encode-output-function nil)
    373373  (decode-input-function nil)
    374   (read-char-when-locked-function nil)
     374  (read-char-when-locked-function 'ioblock-no-char-input)
    375375  (write-simple-string-function 'ioblock-no-char-output)
    376376  (character-read-vector-function 'ioblock-no-char-input)
    377377  (read-line-function 'ioblock-no-char-input)
    378   (write-char-when-locked-function nil)
    379   (read-byte-when-locked-function nil)
    380   (write-byte-when-locked-function nil)
     378  (write-char-when-locked-function 'ioblock-no-char-output)
     379  (read-byte-when-locked-function 'ioblock-no-binary-input)
     380  (write-byte-when-locked-function 'ioblock-no-binary-output)
    381381  (reserved1 nil)
    382382  (reserved2 nil)
     
    442442
    443443
    444 ;;; Should only be called with the ioblock locked, if that's necessary.
    445 
    446 (defun %ioblock-read-byte (ioblock)
    447   (declare (optimize (speed 3) (safety 0)))
    448   ;;; It's so dumb to be dealing with the effect of UNREAD-CHAR
    449   ;;; on a binary stream, but since this is kind of a general
    450   ;;; method, we kind of have to here.
    451   (if (ioblock-untyi-char ioblock)
    452     (prog1 (%char-code (ioblock-untyi-char ioblock))
    453       (setf (ioblock-untyi-char ioblock) nil))
    454     (let* ((buf (ioblock-inbuf ioblock))
    455            (idx (io-buffer-idx buf))
    456            (limit (io-buffer-count buf)))
    457       (declare (fixnum idx limit))
    458       (when (= idx limit)
    459         (unless (%ioblock-advance ioblock t)
    460           (return-from %ioblock-read-byte :eof))
    461         (setq idx (io-buffer-idx buf)
    462               limit (io-buffer-count buf)))
    463       (setf (io-buffer-idx buf) (the fixnum (1+ idx)))
    464       (uvref (io-buffer-buffer buf) idx))))
     444
    465445
    466446
     
    683663)
    684664
    685 (declaim (inline %ioblock-read-swapped-u16-byte))
    686 (defun %ioblock-read-swapped-u16-byte (ioblock)
     665(declaim (inline %ioblock-read-swapped-u16-element))
     666(defun %ioblock-read-swapped-u16-element (ioblock)
    687667  (declare (optimize (speed 3) (safety 0)))
    688668  (let* ((buf (ioblock-inbuf ioblock))
     
    692672    (when (= idx limit)
    693673      (unless (%ioblock-advance ioblock t)
    694         (return-from %ioblock-read-swapped-u16-byte :eof))
     674        (return-from %ioblock-read-swapped-u16-element :eof))
    695675      (setq idx (io-buffer-idx buf)
    696676            limit (io-buffer-count buf)))
    697677    (setf (io-buffer-idx buf) (the fixnum (1+ idx)))
    698     (let* ((u16 (aref (the (simple-array (unsigned-byte 16) (*))
    699             (io-buffer-buffer buf)) idx)))
    700       (declare (type (unsigned-byte 16) u16))
    701       (logand #xffff (the fixnum (logior (the fixnum (ash u16 -8))
    702                                          (the fixnum (ash u16 8))))))))
     678    (%swap-u16 (aref (the (simple-array (unsigned-byte 16) (*))
     679                       (io-buffer-buffer buf)) idx))))
     680
     681(declaim (inline %ioblock-read-swapped-u32-element))
     682(defun %ioblock-read-swapped-u32-element (ioblock)
     683  (declare (optimize (speed 3) (safety 0)))
     684  (let* ((buf (ioblock-inbuf ioblock))
     685         (idx (io-buffer-idx buf))
     686         (limit (io-buffer-count buf)))
     687    (declare (fixnum idx limit))
     688    (when (= idx limit)
     689      (unless (%ioblock-advance ioblock t)
     690        (return-from %ioblock-read-swapped-u32-element :eof))
     691      (setq idx (io-buffer-idx buf)
     692            limit (io-buffer-count buf)))
     693    (setf (io-buffer-idx buf) (the fixnum (1+ idx)))
     694    (%swap-u32 (aref (the (simple-array (unsigned-byte 32) (*))
     695                       (io-buffer-buffer buf)) idx))))
    703696
    704697
     
    729722(defun %bivalent-locked-ioblock-read-u8-byte (ioblock)
    730723  (declare (optimize (speed 3) (safety 0)))
    731   (with-ioblock-lock-grabbed ((locally (declare (optimize (speed 3) (safety 0)))
    732                                 (ioblock-inbuf-lock ioblock)))
     724  (with-ioblock-input-lock-grabbed (ioblock)
    733725    (if (ioblock-untyi-char ioblock)
    734726      (prog1 (%char-code (ioblock-untyi-char ioblock))
     
    11141106    (setf (aref (the (simple-array (unsigned-byte 16) (*))
    11151107                  (io-buffer-buffer buf)) idx)
    1116           (logand #xffff (the fixnum (logior (the fixnum (ash element -8))
    1117                                              (the fixnum (ash element 8))))))
     1108          (%swap-u16 element))
    11181109    (incf idx)
    11191110    (setf (io-buffer-idx buf) idx)
     
    11541145      (setq idx 0 count 0))
    11551146    (setf (aref (the (simple-array (unsigned-byte 32) (*)) (io-buffer-buffer buf)) idx) element)
     1147    (incf idx)
     1148    (setf (io-buffer-idx buf) idx)
     1149    (when (> idx count)
     1150      (setf (io-buffer-count buf) idx))
     1151    (setf (ioblock-dirty ioblock) t)
     1152    element))
     1153
     1154(declaim (inline %ioblock-write-swapped-u32-element))
     1155(defun %ioblock-write-swapped-u32-element (ioblock element)
     1156  (declare (optimize (speed 3) (safety 0)))
     1157  (let* ((buf (ioblock-outbuf ioblock))
     1158         (idx (io-buffer-idx buf))
     1159         (count (io-buffer-count buf))
     1160         (limit (io-buffer-limit buf)))
     1161    (declare (fixnum idx limit count))
     1162    (when (= idx limit)
     1163      (%ioblock-force-output ioblock nil)
     1164      (setq idx 0 count 0))
     1165    (setf (aref (the (simple-array (unsigned-byte 32) (*)) (io-buffer-buffer buf)) idx)
     1166          (%swap-u32 element))
    11561167    (incf idx)
    11571168    (setf (io-buffer-idx buf) idx)
     
    12691280
    12701281
    1271 (defun %ioblock-u8-encoded-write-simple-string (ioblock string start-char num-chars)
     1282(defun %ioblock-write-u8-encoded-simple-string (ioblock string start-char num-chars)
    12721283  (declare (fixnum start-char num-chars)
    12731284           (simple-base-strng string)
     
    12901301        (funcall encode-function char #'%ioblock-write-u8-element ioblock)))))
    12911302
     1303(declaim (inline %ioblock-write-u16-encoded-char))
     1304(defun %ioblock-write-u16-encoded-char (ioblock char)
     1305  (declare (optimize (speed 3) (safety 0)))
     1306  (if (eq char #\linefeed)
     1307    (setf (ioblock-charpos ioblock) 0)
     1308    (incf (ioblock-charpos ioblock)))
     1309  (let* ((code (char-code char)))
     1310    (declare (type (mod #x110000) code))
     1311    (if (< code (the fixnum (ioblock-literal-char-code-limit ioblock)))
     1312      (%ioblock-write-u16-element ioblock code)
     1313      (funcall (ioblock-encode-output-function ioblock)
     1314               char
     1315               #'%ioblock-write-u16-element
     1316               ioblock))))
     1317
     1318(defun %private-ioblock-write-u16-encoded-char (ioblock char)
     1319  (declare (optimize (speed 3) (safety 0)))
     1320  (check-ioblock-owner ioblock)
     1321  (%ioblock-write-u16-encoded-char ioblock char))
     1322
     1323(defun %locked-ioblock-write-u16-encoded-char (ioblock char)
     1324  (declare (optimize (speed 3) (safety 0)))
     1325  (with-ioblock-output-lock-grabbed (ioblock)
     1326    (%ioblock-write-u16-encoded-char ioblock char)))
     1327
     1328(defun %ioblock-write-u16-encoded-simple-string (ioblock string start-char num-chars)
     1329  (declare (fixnum start-char num-chars)
     1330           (simple-base-strng string)
     1331           (optimize (speed 3) (safety 0)))
     1332  (do* ((i 0 (1+ i))
     1333        (col (ioblock-charpos ioblock))
     1334        (limit (ioblock-literal-char-code-limit ioblock))
     1335        (encode-function (ioblock-encode-output-function ioblock))
     1336        (start-char start-char (1+ start-char)))
     1337       ((= i num-chars) (setf (ioblock-charpos ioblock) col) num-chars)
     1338    (declare (fixnum i start-char limit))
     1339    (let* ((char (schar string start-char))
     1340           (code (char-code char)))
     1341      (declare (type (mod #x110000) code))
     1342      (if (eq char #\newline)
     1343        (setq col 0)
     1344        (incf col))
     1345      (if (< code limit)
     1346        (%ioblock-write-u16-element ioblock code)
     1347        (funcall encode-function char #'%ioblock-write-u16-element ioblock)))))
     1348
     1349(declaim (inline %ioblock-write-swapped-u16-encoded-char))
     1350(defun %ioblock-write-swapped-u16-encoded-char (ioblock char)
     1351  (declare (optimize (speed 3) (safety 0)))
     1352  (if (eq char #\linefeed)
     1353    (setf (ioblock-charpos ioblock) 0)
     1354    (incf (ioblock-charpos ioblock)))
     1355  (let* ((code (char-code char)))
     1356    (declare (type (mod #x110000) code))
     1357    (if (< code (the fixnum (ioblock-literal-char-code-limit ioblock)))
     1358      (%ioblock-write-swapped-u16-element ioblock code)
     1359      (funcall (ioblock-encode-output-function ioblock)
     1360               char
     1361               #'%ioblock-write-swapped-u16-element
     1362               ioblock))))
     1363
     1364(defun %private-ioblock-write-swapped-u16-encoded-char (ioblock char)
     1365  (declare (optimize (speed 3) (safety 0)))
     1366  (check-ioblock-owner ioblock)
     1367  (%ioblock-write-swapped-u16-encoded-char ioblock char))
     1368
     1369(defun %locked-ioblock-write-swapped-u16-encoded-char (ioblock char)
     1370  (declare (optimize (speed 3) (safety 0)))
     1371  (with-ioblock-output-lock-grabbed (ioblock)
     1372    (%ioblock-write-swapped-u16-encoded-char ioblock char)))
     1373
     1374
     1375
     1376
    12921377(declaim (inline %ioblock-write-u8-byte))
    12931378(defun %ioblock-write-u8-byte (ioblock byte)
    12941379  (declare (optimize (speed 3) (safety 0)))
    1295   (if (= byte (logand #xff byte))
    1296     (%ioblock-write-u8-element ioblock byte)
    1297     (error "~s doesn't match stream element-type of ~s". (byte (ioblock-stream ioblock)))))
     1380  (%ioblock-write-u8-element ioblock (require-type byte '(unsigned-byte 8))))
    12981381
    12991382(defun %private-ioblock-write-u8-byte (ioblock byte)
     
    13101393(defun %ioblock-write-s8-byte (ioblock byte)
    13111394  (declare (optimize (speed 3) (safety 0)))
    1312   (if (and (typep byte 'fixnum)
    1313            (>= (the fixnum byte) -128)
    1314            (< (the fixnum byte) 128))
    1315     (%ioblock-write-s8-element ioblock byte)
    1316     (error "~s doesn't match stream element-type of ~s". (byte (ioblock-stream ioblock)))))
     1395  (%ioblock-write-s8-element ioblock (require-type byte '(signed-byte 8))))
    13171396
    13181397(defun %private-ioblock-write-s8-byte (ioblock byte)
     
    13291408(defun %ioblock-write-u16-byte (ioblock byte)
    13301409  (declare (optimize (speed 3) (safety 0)))
    1331   (if (= byte (logand #xffff byte))
    1332     (%ioblock-write-u16-element ioblock byte)
    1333     (error "~s doesn't match stream element-type of ~s". (byte (ioblock-stream ioblock)))))
     1410  (%ioblock-write-u16-element ioblock (require-type byte '(unsigned-byte 16))))
    13341411
    13351412(defun %private-ioblock-write-u16-byte (ioblock byte)
     
    13461423(defun %ioblock-write-s16-byte (ioblock byte)
    13471424  (declare (optimize (speed 3) (safety 0)))
    1348   (if (and (typep byte 'fixnum)
    1349            (>= (the fixnum byte) -32768)
    1350            (< (the fixnum byte) 32768))
    1351     (%ioblock-write-s16-element ioblock byte)
    1352     (error "~s doesn't match stream element-type of ~s". (byte (ioblock-stream ioblock)))))
     1425  (%ioblock-write-s16-element ioblock (require-type byte '(signed-byte 16))))
    13531426
    13541427(defun %private-ioblock-write-s16-byte (ioblock byte)
     
    13621435    (%ioblock-write-s16-byte ioblock byte)))
    13631436
    1364 
     1437(declaim (inline %ioblock-write-u32-byte))
     1438(defun %ioblock-write-u32-byte (ioblock byte)
     1439  (declare (optimize (speed 3) (safety 0)))
     1440  (%ioblock-write-u32-element ioblock (require-type byte '(unsigned-byte 32))))
     1441
     1442(defun %private-ioblock-write-u32-byte (ioblock byte)
     1443  (declare (optimize (speed 3) (safety 0)))
     1444  (check-ioblock-owner ioblock)
     1445  (%ioblock-write-u32-byte ioblock byte))
     1446
     1447(defun %locked-ioblock-write-u32-byte (ioblock byte)
     1448  (declare (optimize (speed 3) (safety 0)))
     1449  (with-ioblock-output-lock-grabbed (ioblock)
     1450    (%ioblock-write-u32-byte ioblock byte)))
     1451
     1452(declaim (inline %ioblock-write-s32-byte))
     1453(defun %ioblock-write-s32-byte (ioblock byte)
     1454  (declare (optimize (speed 3) (safety 0)))
     1455  (%ioblock-write-s32-element ioblock (require-type byte '(signed-byte 32))))
     1456
     1457(defun %private-ioblock-write-s32-byte (ioblock byte)
     1458  (declare (optimize (speed 3) (safety 0)))
     1459  (check-ioblock-owner ioblock)
     1460  (%ioblock-write-s32-byte ioblock byte))
     1461
     1462(defun %locked-ioblock-write-s32-byte (ioblock byte)
     1463  (declare (optimize (speed 3) (safety 0)))
     1464  (with-ioblock-output-lock-grabbed (ioblock)
     1465    (%ioblock-write-s32-byte ioblock byte)))
     1466
     1467#+64-bit-target
     1468(progn
     1469(declaim (inline %ioblock-write-u64-byte))
     1470(defun %ioblock-write-u64-byte (ioblock byte)
     1471  (declare (optimize (speed 3) (safety 0)))
     1472  (%ioblock-write-u64-element ioblock (require-type byte '(unsigned-byte 64))))
     1473
     1474(defun %private-ioblock-write-u64-byte (ioblock byte)
     1475  (declare (optimize (speed 3) (safety 0)))
     1476  (check-ioblock-owner ioblock)
     1477  (%ioblock-write-u64-byte ioblock byte))
     1478
     1479(defun %locked-ioblock-write-u64-byte (ioblock byte)
     1480  (declare (optimize (speed 3) (safety 0)))
     1481  (with-ioblock-output-lock-grabbed (ioblock)
     1482    (%ioblock-write-u64-byte ioblock byte)))
     1483
     1484(declaim (inline %ioblock-write-s64-byte))
     1485(defun %ioblock-write-s64-byte (ioblock byte)
     1486  (declare (optimize (speed 3) (safety 0)))
     1487  (%ioblock-write-s64-element ioblock (require-type byte '(signed-byte 64))))
     1488
     1489(defun %private-ioblock-write-s64-byte (ioblock byte)
     1490  (declare (optimize (speed 3) (safety 0)))
     1491  (check-ioblock-owner ioblock)
     1492  (%ioblock-write-s64-byte ioblock byte))
     1493
     1494(defun %locked-ioblock-write-s64-byte (ioblock byte)
     1495  (declare (optimize (speed 3) (safety 0)))
     1496  (with-ioblock-output-lock-grabbed (ioblock)
     1497    (%ioblock-write-s64-byte ioblock byte)))
     1498)                                       ;#+64-bit-target
    13651499
    13661500(defun %ioblock-clear-output (ioblock)
     
    14491583  (declare (fixnum start end))
    14501584  (let* ((in (ioblock-inbuf ioblock))
    1451          (inbuf (io-buffer-buffer in)))
     1585         (inbuf (io-buffer-buffer in))
     1586         (rbf (ioblock-read-byte-when-locked-function ioblock)))
    14521587    (if (not (= (the fixnum (typecode inbuf))
    14531588                (the fixnum (typecode vector))))
     
    14551590           ((= i end) i)
    14561591        (declare (fixnum i))
    1457         (let* ((b (%ioblock-read-byte ioblock)))
     1592        (let* ((b (funcall rbf ioblock)))
    14581593          (if (eq b :eof)
    14591594            (return i)
     
    14631598           ((= i end) end)
    14641599        (declare (fixnum i need))
    1465         (let* ((ch (%ioblock-read-byte ioblock)))
    1466           (if (eq ch :eof)
     1600        (let* ((b (funcall rbf ioblock)))
     1601          (if (eq b :eof)
    14671602            (return i))
    1468           (setf (uvref vector i) ch)
     1603          (setf (uvref vector i) b)
    14691604          (incf i)
    14701605          (decf need)
     
    15271662    (error "Can't read vector from stream ~s" (ioblock-stream ioblock)))
    15281663  (do* ((i start)
     1664        (rbf (ioblock-read-byte-when-locked-function ioblock))
    15291665        (in (ioblock-inbuf ioblock))
    15301666        (inbuf (io-buffer-buffer in))
     
    15331669       ((= i end) nb)
    15341670    (declare (fixnum i end need))
    1535     (let* ((b (%ioblock-read-byte ioblock)))
     1671    (let* ((b (funcall rbf ioblock)))
    15361672      (if (eq b :eof)
    15371673        (return (- i start)))
     
    15901726              (ecase unit-size
    15911727                (8
     1728                 (setf (ioblock-read-char-when-locked-function ioblock)
     1729                       '%ioblock-read-u8-encoded-char)
    15921730                 (case sharing
    15931731                   (:private '%private-ioblock-read-u8-encoded-char)
     
    16001738                (:lock '%locked-ioblock-tyi)
    16011739                (t '%ioblock-tyi)))
     1740        (setf (ioblock-read-char-when-locked-function ioblock)
     1741              '%ioblock-tyi)
    16021742        (setf (ioblock-character-read-vector-function ioblock)
    16031743              '%ioblock-unencoded-character-read-vector)
     
    16121752                   (if character-p
    16131753                     ;; The bivalent case, at least for now
    1614                      (case sharing
    1615                        (:private '%bivalent-private-ioblock-read-u8-byte)
    1616                        (:lock '%bivalent-locked-ioblock-read-u8-byte)
    1617                        (t '%bivalent-ioblock-read-u8-byte))
    1618                      (case sharing
    1619                        (:private '%private-ioblock-read-u8-byte)
    1620                        (:lock '%locked-ioblock-read-u8-byte)
    1621                        (t '%ioblock-read-u8-byte))))
     1754                     (progn
     1755                       (setf (ioblock-read-byte-when-locked-function ioblock)
     1756                             '%bivalent-ioblock-read-u8-byte)
     1757                       (case sharing
     1758                         (:private '%bivalent-private-ioblock-read-u8-byte)
     1759                         (:lock '%bivalent-locked-ioblock-read-u8-byte)
     1760                         (t '%bivalent-ioblock-read-u8-byte)))
     1761                     (progn
     1762                       (setf (ioblock-read-byte-when-locked-function ioblock)
     1763                             '%ioblock-read-u8-byte)
     1764                       (case sharing
     1765                         (:private '%private-ioblock-read-u8-byte)
     1766                         (:lock '%locked-ioblock-read-u8-byte)
     1767                         (t '%ioblock-read-u8-byte)))))
    16221768                  ((= subtag target::subtag-s8-vector)
    1623                      (case sharing
    1624                        (:private '%private-ioblock-read-s8-byte)
    1625                        (:lock '%locked-ioblock-read-s8-byte)
    1626                        (t '%ioblock-read-s8-byte)))
     1769                   (setf (ioblock-read-byte-when-locked-function ioblock)
     1770                         '%ioblock-read-s8-byte)
     1771                   (case sharing
     1772                     (:private '%private-ioblock-read-s8-byte)
     1773                     (:lock '%locked-ioblock-read-s8-byte)
     1774                     (t '%ioblock-read-s8-byte)))
    16271775                  ((= subtag target::subtag-u16-vector)
    1628                      (case sharing
    1629                        (:private '%private-ioblock-read-u16-byte)
    1630                        (:lock '%locked-ioblock-read-u16-byte)
    1631                        (t '%ioblock-read-u16-byte)))
     1776                   (setf (ioblock-read-byte-when-locked-function ioblock)
     1777                         '%ioblock-read-u16-byte)
     1778                   (case sharing
     1779                     (:private '%private-ioblock-read-u16-byte)
     1780                     (:lock '%locked-ioblock-read-u16-byte)
     1781                     (t '%ioblock-read-u16-byte)))
    16321782                  ((= subtag target::subtag-s16-vector)
    1633                      (case sharing
    1634                        (:private '%private-ioblock-read-s16-byte)
    1635                        (:lock '%locked-ioblock-read-s16-byte)
    1636                        (t '%ioblock-read-s16-byte)))
     1783                   (setf (ioblock-read-byte-when-locked-function ioblock)
     1784                         '%ioblock-read-s16-byte)
     1785                   (case sharing
     1786                     (:private '%private-ioblock-read-s16-byte)
     1787                     (:lock '%locked-ioblock-read-s16-byte)
     1788                     (t '%ioblock-read-s16-byte)))
    16371789                  ((= subtag target::subtag-u32-vector)
    1638                      (case sharing
    1639                        (:private '%private-ioblock-read-u32-byte)
    1640                        (:lock '%locked-ioblock-read-u32-byte)
    1641                        (t '%ioblock-read-u32-byte)))
     1790                   (setf (ioblock-read-byte-when-locked-function ioblock)
     1791                         '%ioblock-read-u32-byte)
     1792                   (case sharing
     1793                     (:private '%private-ioblock-read-u32-byte)
     1794                     (:lock '%locked-ioblock-read-u32-byte)
     1795                     (t '%ioblock-read-u32-byte)))
    16421796                  ((= subtag target::subtag-s32-vector)
    1643                      (case sharing
    1644                        (:private '%private-ioblock-read-s32-byte)
    1645                        (:lock '%locked-ioblock-read-s32-byte)
    1646                        (t '%ioblock-read-s32-byte)))
     1797                   (setf (ioblock-read-byte-when-locked-function ioblock)
     1798                         '%ioblock-read-s32-byte)                   
     1799                   (case sharing
     1800                     (:private '%private-ioblock-read-s32-byte)
     1801                     (:lock '%locked-ioblock-read-s32-byte)
     1802                     (t '%ioblock-read-s32-byte)))
    16471803                  #+64-bit-target
    16481804                  ((= subtag target::subtag-u64-vector)
    1649                      (case sharing
    1650                        (:private '%private-ioblock-read-u64-byte)
    1651                        (:lock '%locked-ioblock-read-u64-byte)
    1652                        (t '%ioblock-read-u64-byte)))
     1805                   (setf (ioblock-read-byte-when-locked-function ioblock)
     1806                         '%ioblock-read-u64-byte)                   
     1807                   (case sharing
     1808                     (:private '%private-ioblock-read-u64-byte)
     1809                     (:lock '%locked-ioblock-read-u64-byte)
     1810                     (t '%ioblock-read-u64-byte)))
    16531811                  #+64-bit-target
    16541812                  ((= subtag target::subtag-s64-vector)
    1655                      (case sharing
    1656                        (:private '%private-ioblock-read-s64-byte)
    1657                        (:lock '%locked-ioblock-read-s64-byte)
    1658                        (t '%ioblock-read-s64-byte)))
    1659                   (t '%general-ioblock-read-byte))))))
     1813                   (setf (ioblock-read-byte-when-locked-function ioblock)
     1814                         '%ioblock-read-s64-byte)
     1815                   (case sharing
     1816                     (:private '%private-ioblock-read-s64-byte)
     1817                     (:lock '%locked-ioblock-read-s64-byte)
     1818                     (t '%ioblock-read-s64-byte)))
     1819                  ;; Not sure what this means, currently.
     1820                  (t
     1821                   (setf (ioblock-read-byte-when-locked-function ioblock)
     1822                         '%general-ioblock-read-byte)
     1823                   '%general-ioblock-read-byte))))))
    16601824
    16611825(defun setup-ioblock-output (ioblock character-p element-type sharing encoding)
     
    16681832              (ecase unit-size
    16691833                (8
     1834                 (setf (ioblock-write-char-when-locked-function ioblock)
     1835                      '%ioblock-write-u8-encoded-char)
    16701836                 (case sharing
    16711837                   (:private '%private-ioblock-write-u8-encoded-char)
     
    16741840        (setf (ioblock-write-simple-string-function ioblock)
    16751841              (ecase unit-size
    1676                 (8 '%ioblock-u8-encoded-write-simple-string))))
     1842                (8 '%ioblock-write-u8-encoded-simple-string))))
    16771843      (progn
    16781844        (setf (ioblock-write-simple-string-function ioblock)
    16791845              '%ioblock-unencoded-write-simple-string)
     1846        (setf (ioblock-write-char-when-locked-function ioblock)
     1847              '%ioblock-write-char)
    16801848        (setf (ioblock-write-char-function ioblock)
    16811849              (case sharing
     
    16911859                   (if character-p
    16921860                     ;; The bivalent case, at least for now
    1693                      (case sharing
    1694                        (:private '%bivalent-private-ioblock-write-u8-byte)
    1695                        (:lock '%bivalent-locked-ioblock-write-u8-byte)
    1696                        (t '%bivalent-ioblock-write-u8-byte))
    1697                      (case sharing
    1698                        (:private '%private-ioblock-write-u8-byte)
    1699                        (:lock '%locked-ioblock-write-u8-byte)
    1700                        (t '%ioblock-write-u8-byte))))
     1861                     (progn
     1862                       (setf (ioblock-write-byte-when-locked-function ioblock)
     1863                             '%bivalent-ioblock-write-u8-byte)
     1864                       (case sharing
     1865                         (:private '%bivalent-private-ioblock-write-u8-byte)
     1866                         (:lock '%bivalent-locked-ioblock-write-u8-byte)
     1867                         (t '%bivalent-ioblock-write-u8-byte)))
     1868                     (progn
     1869                       (setf (ioblock-write-byte-when-locked-function ioblock)
     1870                             '%ioblock-write-u8-byte)
     1871                       (case sharing
     1872                         (:private '%private-ioblock-write-u8-byte)
     1873                         (:lock '%locked-ioblock-write-u8-byte)
     1874                         (t '%ioblock-write-u8-byte)))))
    17011875                  ((= subtag target::subtag-s8-vector)
     1876                   (setf (ioblock-write-byte-when-locked-function ioblock)
     1877                         '%ioblock-write-s8-byte)                   
    17021878                     (case sharing
    17031879                       (:private '%private-ioblock-write-s8-byte)
     
    17051881                       (t '%ioblock-write-s8-byte)))
    17061882                  ((= subtag target::subtag-u16-vector)
     1883                   (setf (ioblock-write-byte-when-locked-function ioblock)
     1884                         '%ioblock-write-u16-byte)                   
    17071885                     (case sharing
    17081886                       (:private '%private-ioblock-write-u16-byte)
     
    17101888                       (t '%ioblock-write-u16-byte)))
    17111889                  ((= subtag target::subtag-s16-vector)
     1890                   (setf (ioblock-write-byte-when-locked-function ioblock)
     1891                         '%ioblock-write-s16-byte)                                     
    17121892                     (case sharing
    17131893                       (:private '%private-ioblock-write-s16-byte)
     
    17151895                       (t '%ioblock-write-s16-byte)))
    17161896                  ((= subtag target::subtag-u32-vector)
     1897                   (setf (ioblock-write-byte-when-locked-function ioblock)
     1898                         '%ioblock-write-u32-byte)                                     
    17171899                     (case sharing
    17181900                       (:private '%private-ioblock-write-u32-byte)
     
    17201902                       (t '%ioblock-write-u32-byte)))
    17211903                  ((= subtag target::subtag-s32-vector)
    1722                      (case sharing
     1904                   (setf (ioblock-write-byte-when-locked-function ioblock)
     1905                         '%ioblock-write-s32-byte)
     1906                   (case sharing
    17231907                       (:private '%private-ioblock-write-s32-byte)
    17241908                       (:lock '%locked-ioblock-write-s32-byte)
     
    17261910                  #+64-bit-target
    17271911                  ((= subtag target::subtag-u64-vector)
    1728                      (case sharing
     1912                   (setf (ioblock-write-byte-when-locked-function ioblock)
     1913                         '%ioblock-write-u64-byte)
     1914                   (case sharing
    17291915                       (:private '%private-ioblock-write-u64-byte)
    17301916                       (:lock '%locked-ioblock-write-u64-byte)
     
    17321918                  #+64-bit-target
    17331919                  ((= subtag target::subtag-s64-vector)
    1734                      (case sharing
     1920                   (setf (ioblock-write-byte-when-locked-function ioblock)
     1921                         '%ioblock-write-u64-byte)
     1922                   (case sharing
    17351923                       (:private '%private-ioblock-write-s64-byte)
    17361924                       (:lock '%locked-ioblock-write-s64-byte)
    17371925                       (t '%ioblock-write-s64-byte)))
    1738                   (t '%general-ioblock-write-byte))))))
     1926                  (t
     1927                   (setf (ioblock-write-byte-when-locked-function ioblock)
     1928                         '%general-ioblock-write-byte)                   
     1929                   '%general-ioblock-write-byte))))))
    17391930
    17401931(defun buffer-element-type-for-character-encoding (encoding)
Note: See TracChangeset for help on using the changeset viewer.