1.0.28.8: micro-optimize OUCH-READ-BUFFER
authorNathan Froyd <froydnj@cs.rice.edu>
Fri, 1 May 2009 21:01:57 +0000 (21:01 +0000)
committerNathan Froyd <froydnj@cs.rice.edu>
Fri, 1 May 2009 21:01:57 +0000 (21:01 +0000)
Remove an array bounds check and a couple of BOUNDP checks.

src/code/reader.lisp
version.lisp-expr

index e6652f3..308d3dd 100644 (file)
@@ -456,11 +456,13 @@ standard Lisp readtable when NIL."
 (declaim (inline ouch-read-buffer))
 (defun ouch-read-buffer (char)
   ;; When buffer overflow
-  (when (>= *ouch-ptr* (length *read-buffer*))
+  (let ((op *ouch-ptr*))
+    (declare (optimize (sb!c::insert-array-bounds-checks 0)))
+    (when (>= op (length *read-buffer*))
     ;; Size should be doubled.
-    (grow-read-buffer))
-  (setf (elt *read-buffer* *ouch-ptr*) char)
-  (setq *ouch-ptr* (1+ *ouch-ptr*)))
+      (grow-read-buffer))
+    (setf (elt *read-buffer* op) char)
+    (setq *ouch-ptr* (1+ op))))
 
 (defun grow-read-buffer ()
   (let* ((rbl (length *read-buffer*))
index 76bf0e0..8033af8 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.28.7"
+"1.0.28.8"