Skip to content
Snippets Groups Projects
Commit 7045eca3 authored by dtc's avatar dtc
Browse files

Rework the code generated by emit-reader/writer to help the compiler

generate better code.
parent a3200a5f
No related branches found
No related tags found
No related merge requests found
...@@ -152,18 +152,20 @@ ...@@ -152,18 +152,20 @@
((fsc-instance-p ,instance) ((fsc-instance-p ,instance)
,@(unless class-slot-p ,@(unless class-slot-p
`((setq slots (fsc-instance-slots ,instance)))) `((setq slots (fsc-instance-slots ,instance))))
(fsc-instance-wrapper ,instance)))) (fsc-instance-wrapper ,instance)))))
,@(when readp '(value))) (block access
(if (or (null wrapper) (when (and wrapper
(zerop (wrapper-cache-number-vector-ref wrapper ,field)) (/= (wrapper-cache-number-vector-ref wrapper ,field) 0)
(not (or (eq wrapper wrapper-0) ,@(if (eql 1 1-or-2-class)
,@(when (eql 2 1-or-2-class) `((eq wrapper wrapper-0))
`((eq wrapper wrapper-1))))) `((or (eq wrapper wrapper-0)
,@(when readp `((eq *slot-unbound* (setq value ,read-form))))) (eq wrapper wrapper-1)))))
(funcall miss-fn ,@arglist) ,@(if readp
,(if readp `((let ((value ,read-form))
'value (unless (eq value *slot-unbound*)
`(setf ,read-form ,(car arglist)))))))) (return-from access value))))
`((return-from access (setf ,read-form ,(car arglist))))))
(funcall miss-fn ,@arglist))))))
(defun emit-slot-read-form (class-slot-p index slots) (defun emit-slot-read-form (class-slot-p index slots)
(if class-slot-p (if class-slot-p
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment