Changeset 12086
- Timestamp:
- 08/08/09 15:20:28 (14 years ago)
- Location:
- trunk/abcl/src/org/armedbear/lisp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/compiler-pass1.lisp
r12040 r12086 234 234 235 235 (defun p1-locally (form) 236 (let ((*visible-variables* *visible-variables*) 237 (specials (process-special-declarations (cdr form)))) 238 (dolist (name specials) 236 (let* ((*visible-variables* *visible-variables*) 237 (block (make-block-node '(LOCALLY))) 238 (free-specials (process-declarations-for-vars (cdr form) nil))) 239 (setf (block-free-specials block) free-specials) 240 (dolist (special free-specials) 239 241 ;; (format t "p1-locally ~S is special~%" name) 240 (push (make-variable :name name :special-p t) *visible-variables*)) 241 (setf (cdr form) (p1-body (cdr form))) 242 form)) 242 (push special *visible-variables*)) 243 (let ((*blocks* (cons block *blocks*))) 244 (setf (block-form block) 245 (list* 'LOCALLY (p1-body (cdr form)))) 246 block))) 243 247 244 248 (defknown p1-m-v-b (t) t) … … 632 636 ((with-saved-compiler-policy 633 637 (process-optimization-declarations (cddr form)) 634 (list* (car form) local-functions (p1-body (cddr form))))))) 638 (let* ((block (make-block-node '(FLET))) 639 (*blocks* (cons block *blocks*)) 640 (body (cddr form)) 641 (*visible-variables* *visible-variables*)) 642 (setf (block-free-specials block) 643 (process-declarations-for-vars body nil)) 644 (dolist (special (block-free-specials block)) 645 (push special *visible-variables*)) 646 (setf (block-form block) 647 (list* (car form) local-functions (p1-body (cddr form)))) 648 block))))) 635 649 636 650 … … 652 666 (*current-compiland* (local-function-compiland local-function))) 653 667 (p1-compiland (local-function-compiland local-function)))) 654 (list* (car form) local-functions (p1-body (cddr form)))))) 668 (let* ((block (make-block-node '(LABELS))) 669 (*blocks* (cons block *blocks*)) 670 (body (cddr form)) 671 (*visible-variables* *visible-variables*)) 672 (setf (block-free-specials block) 673 (process-declarations-for-vars body nil)) 674 (dolist (special (block-free-specials block)) 675 (push special *visible-variables*)) 676 (setf (block-form block) 677 (list* (car form) local-functions (p1-body (cddr form)))) 678 block)))) 655 679 656 680 (defknown p1-funcall (t) t) -
trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp
r12071 r12086 4437 4437 label-START)))) 4438 4438 4439 (defun p2-locally (form target representation) 4439 (defknown p2-locally-node (t t t) t) 4440 (defun p2-locally-node (block target representation) 4440 4441 (with-saved-compiler-policy 4441 (let* ((body (cdr form)) 4442 (*visible-variables* *visible-variables*) 4443 (specials (process-special-declarations body))) 4444 (dolist (name specials) 4445 (push (make-variable :name name :special-p t) *visible-variables*)) 4442 (let* ((body (cdr (block-form block))) 4443 (*visible-variables* (append (block-free-specials block) 4444 *visible-variables*)) 4445 (*blocks* (cons block *blocks*))) 4446 4446 (process-optimization-declarations body) 4447 4447 (compile-progn-body body target representation)))) … … 4953 4953 local-function compiland g))))))) 4954 4954 4955 (defknown p2-flet (t t t) t) 4956 (defun p2-flet (form target representation) 4957 (let ((*local-functions* *local-functions*) 4958 (*visible-variables* *visible-variables*) 4959 (local-functions (cadr form)) 4960 (body (cddr form))) 4955 (defknown p2-flet-node (t t t) t) 4956 (defun p2-flet-node (block target representation) 4957 (let* ((form (block-form block)) 4958 (*local-functions* *local-functions*) 4959 (*visible-variables* *visible-variables*) 4960 (local-functions (cadr form)) 4961 (body (cddr form))) 4961 4962 (dolist (local-function local-functions) 4962 4963 (p2-flet-process-compiland local-function)) 4963 4964 (dolist (local-function local-functions) 4964 4965 (push local-function *local-functions*)) 4965 (dolist (special ( process-special-declarations body))4966 (push (make-variable :name special :special-p t)*visible-variables*))4966 (dolist (special (block-free-specials block)) 4967 (push special *visible-variables*)) 4967 4968 (compile-progn-body body target representation))) 4968 4969 4969 (defknown p2-labels (t t t) t) 4970 (defun p2-labels (form target representation) 4971 (let ((*local-functions* *local-functions*) 4972 (*visible-variables* *visible-variables*) 4973 (local-functions (cadr form)) 4974 (body (cddr form))) 4970 (defknown p2-labels-node (t t t) t) 4971 (defun p2-labels-node (block target representation) 4972 (let* ((form (block-form block)) 4973 (*local-functions* *local-functions*) 4974 (*visible-variables* *visible-variables*) 4975 (local-functions (cadr form)) 4976 (body (cddr form))) 4975 4977 (dolist (local-function local-functions) 4976 4978 (push local-function *local-functions*) … … 4983 4985 (dolist (local-function local-functions) 4984 4986 (p2-labels-process-compiland local-function)) 4985 (dolist (special ( process-special-declarations body))4986 (push (make-variable :name special :special-p t)*visible-variables*))4987 (dolist (special (block-free-specials block)) 4988 (push special *visible-variables*)) 4987 4989 (compile-progn-body body target representation))) 4988 4990 … … 7902 7904 (compile-var-ref form target representation)) 7903 7905 ((block-node-p form) 7904 (cond ((equal (block-name form) '(TAGBODY)) 7905 (p2-tagbody-node form target) 7906 (fix-boxing representation nil)) 7907 ((equal (block-name form) '(LET)) 7908 (p2-let/let*-node form target representation)) 7909 ((equal (block-name form) '(MULTIPLE-VALUE-BIND)) 7910 (p2-m-v-b-node form target) 7911 (fix-boxing representation nil)) 7912 ((equal (block-name form) '(UNWIND-PROTECT)) 7913 (p2-unwind-protect-node form target) 7914 (fix-boxing representation nil)) 7915 ((equal (block-name form) '(CATCH)) 7916 (p2-catch-node form target) 7917 (fix-boxing representation nil)) 7918 ((equal (block-name form) '(PROGV)) 7919 (p2-progv-node form target representation)) 7920 ((equal (block-name form) '(THREADS:SYNCHRONIZED-ON)) 7921 (p2-threads-synchronized-on form target) 7922 (fix-boxing representation nil)) 7923 (t 7924 (p2-block-node form target representation)))) 7906 (let ((name (block-name form))) 7907 (if (not (consp name)) 7908 (p2-block-node form target representation) 7909 (let ((name (car name))) 7910 (cond ((eq name 'TAGBODY) 7911 (p2-tagbody-node form target) 7912 (fix-boxing representation nil)) 7913 ((eq name 'LET) 7914 (p2-let/let*-node form target representation)) 7915 ((eq name 'FLET) 7916 (p2-flet-node form target representation)) 7917 ((eq name 'LABELS) 7918 (p2-labels-node form target representation)) 7919 ((eq name 'MULTIPLE-VALUE-BIND) 7920 (p2-m-v-b-node form target) 7921 (fix-boxing representation nil)) 7922 ((eq name 'UNWIND-PROTECT) 7923 (p2-unwind-protect-node form target) 7924 (fix-boxing representation nil)) 7925 ((eq name 'CATCH) 7926 (p2-catch-node form target) 7927 (fix-boxing representation nil)) 7928 ((eq name 'PROGV) 7929 (p2-progv-node form target representation)) 7930 ((eq name 'LOCALLY) 7931 (p2-locally-node form target representation)) 7932 ((eq name 'THREADS:SYNCHRONIZED-ON) 7933 (p2-threads-synchronized-on form target) 7934 (fix-boxing representation nil))))))) 7925 7935 ((constantp form) 7926 7936 (compile-constant form target representation)) … … 8597 8607 (install-p2-handler 'find-class 'p2-find-class) 8598 8608 (install-p2-handler 'fixnump 'p2-fixnump) 8599 (install-p2-handler 'flet 'p2-flet)8600 8609 (install-p2-handler 'funcall 'p2-funcall) 8601 8610 (install-p2-handler 'function 'p2-function) … … 8607 8616 (install-p2-handler 'go 'p2-go) 8608 8617 (install-p2-handler 'if 'p2-if) 8609 (install-p2-handler 'labels 'p2-labels)8610 8618 (install-p2-handler 'length 'p2-length) 8611 8619 (install-p2-handler 'list 'p2-list) … … 8614 8622 (install-p2-handler 'sys::backq-list* 'p2-list*) 8615 8623 (install-p2-handler 'load-time-value 'p2-load-time-value) 8616 (install-p2-handler 'locally 'p2-locally)8617 8624 (install-p2-handler 'logand 'p2-logand) 8618 8625 (install-p2-handler 'logior 'p2-logior)
Note: See TracChangeset
for help on using the changeset viewer.