From: Nikodemus Siivola Date: Fri, 9 Dec 2011 14:56:10 +0000 (+0200) Subject: use FAST-READ-BYTE in LOAD-S-INTEGER X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=a9ca350b35a3336f81e7bf509007366b025ac8e3;p=sbcl.git use FAST-READ-BYTE in LOAD-S-INTEGER No reason not to. --- diff --git a/src/code/fop.lisp b/src/code/fop.lisp index 91fa04e..9f6d58b 100644 --- a/src/code/fop.lisp +++ b/src/code/fop.lisp @@ -266,17 +266,18 @@ ;;; Load a signed integer LENGTH bytes long from *FASL-INPUT-STREAM*. (defun load-s-integer (length) - (declare (fixnum length)) - ;; #+cmu (declare (optimize (inhibit-warnings 2))) - (do* ((index length (1- index)) - (byte 0 (read-byte *fasl-input-stream*)) - (result 0 (+ result (ash byte bits))) - (bits 0 (+ bits 8))) - ((= index 0) - (if (logbitp 7 byte) ; look at sign bit - (- result (ash 1 bits)) - result)) - (declare (fixnum index byte bits)))) + (declare (fixnum length) + (optimize speed)) + (with-fast-read-byte ((unsigned-byte 8) *fasl-input-stream*) + (do* ((index length (1- index)) + (byte 0 (fast-read-byte)) + (result 0 (+ result (ash byte bits))) + (bits 0 (+ bits 8))) + ((= index 0) + (if (logbitp 7 byte) ; look at sign bit + (- result (ash 1 bits)) + result)) + (declare (fixnum index byte bits))))) (define-cloned-fops (fop-integer 33) (fop-small-integer 34) (load-s-integer (clone-arg)))