Changeset 5347
- Timestamp:
- Oct 14, 2006, 5:30:09 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/ccl/lib/defstruct.lisp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ccl/lib/defstruct.lisp
r2325 r5347 148 148 ; no #. for cross compile 149 149 (defvar *struct-ref-vector* 150 (vector #'(lambda (x) ( declare (optimize (safety 3))) (struct-ref x 0))151 #'(lambda (x) ( declare (optimize (safety 3))) (struct-ref x 1))152 #'(lambda (x) ( declare (optimize (safety 3))) (struct-ref x 2))153 #'(lambda (x) ( declare (optimize (safety 3))) (struct-ref x 3))154 #'(lambda (x) ( declare (optimize (safety 3))) (struct-ref x 4))155 #'(lambda (x) ( declare (optimize (safety 3))) (struct-ref x 5))156 #'(lambda (x) ( declare (optimize (safety 3))) (struct-ref x 6))157 #'(lambda (x) ( declare (optimize (safety 3))) (struct-ref x 7))158 #'(lambda (x) ( declare (optimize (safety 3))) (struct-ref x 8))159 #'(lambda (x) ( declare (optimize (safety 3))) (struct-ref x 9))))150 (vector #'(lambda (x) (struct-ref x 0)) 151 #'(lambda (x) (struct-ref x 1)) 152 #'(lambda (x) (struct-ref x 2)) 153 #'(lambda (x) (struct-ref x 3)) 154 #'(lambda (x) (struct-ref x 4)) 155 #'(lambda (x) (struct-ref x 5)) 156 #'(lambda (x) (struct-ref x 6)) 157 #'(lambda (x) (struct-ref x 7)) 158 #'(lambda (x) (struct-ref x 8)) 159 #'(lambda (x) (struct-ref x 9)))) 160 160 161 161 (defvar *svref-vector* 162 (vector #'(lambda (x) ( declare (optimize (safety 3))) (svref x 0))163 #'(lambda (x) ( declare (optimize (safety 3))) (svref x 1))164 #'(lambda (x) ( declare (optimize (safety 3))) (svref x 2))165 #'(lambda (x) ( declare (optimize (safety 3))) (svref x 3))166 #'(lambda (x) ( declare (optimize (safety 3))) (svref x 4))167 #'(lambda (x) ( declare (optimize (safety 3))) (svref x 5))168 #'(lambda (x) ( declare (optimize (safety 3))) (svref x 6))169 #'(lambda (x) ( declare (optimize (safety 3))) (svref x 7))170 #'(lambda (x) ( declare (optimize (safety 3))) (svref x 8))171 #'(lambda (x) ( declare (optimize (safety 3))) (svref x 9))))162 (vector #'(lambda (x) (svref x 0)) 163 #'(lambda (x) (svref x 1)) 164 #'(lambda (x) (svref x 2)) 165 #'(lambda (x) (svref x 3)) 166 #'(lambda (x) (svref x 4)) 167 #'(lambda (x) (svref x 5)) 168 #'(lambda (x) (svref x 6)) 169 #'(lambda (x) (svref x 7)) 170 #'(lambda (x) (svref x 8)) 171 #'(lambda (x) (svref x 9)))) 172 172 173 173 … … 188 188 (%svref '#(first second third fourth fifth 189 189 sixth seventh eighth ninth tenth) offset))) 190 `(defun ,name (x) (declare (optimize (safety 3)))(nth ,offset x))))190 `(defun ,name (x) (nth ,offset x)))) 191 191 ((eq ref $defstruct-struct) 192 192 (if (and (%i< offset 10) *defstruct-share-accessor-functions*) 193 193 `(fset ',name , (%svref *struct-ref-vector* offset)) 194 `(defun ,name (x) (declare (optimize (safety 3)))(struct-ref x ,offset))))194 `(defun ,name (x) (struct-ref x ,offset)))) 195 195 ((or (eq ref target::subtag-simple-vector) 196 196 (eq ref $defstruct-simple-vector)) 197 197 (if (and (%i< offset 10) *defstruct-share-accessor-functions*) 198 198 `(fset ',name ,(%svref *svref-vector* offset)) 199 `(defun ,name (x) (declare (optimize (safety 3)))(svref x ,offset))))199 `(defun ,name (x) (svref x ,offset)))) 200 200 (t `(defun ,name (x) (uvref x ,offset))))) 201 201
Note:
See TracChangeset
for help on using the changeset viewer.
