Changeset 13523 for trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp
- Timestamp:
- 08/21/11 12:54:20 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp
r13520 r13523 6882 6882 (defknown compile-form (t t t) t) 6883 6883 (defun compile-form (form target representation) 6884 (cond ((consp form)6885 (let* ((op (%car form))6886 (handler (and (symbolp op) (get op 'p2-handler))))6887 (cond (handler6888 (funcall handler form target representation))6889 ((symbolp op)6890 (cond ((macro-function op *compile-file-environment*)6891 (compile-form (macroexpand form *compile-file-environment*)6892 target representation))6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 (cond ((null form)6907 (emit-push-false representation)6908 (emit-move-from-stack target representation))6909 ((eq form t)6910 (emit-push-true representation)6911 (emit-move-from-stack target representation))6912 ((keywordp form)6913 (ecase representation6914 (:boolean6915 (emit 'iconst_1))6916 ((nil)6917 (emit-load-externalized-object form)))6918 (emit-move-from-stack target representation))6919 (t6920 ;; Shouldn't happen.6921 (aver nil))))6922 ( (var-ref-p form)6923 (compile-var-ref form target representation))6924 ((node-p form)6925 (cond6926 ((jump-node-p form)6927 (let ((op (car (node-form form))))6928 (cond6929 ((eq op 'go)6930 (p2-go form target representation))6931 ((eq op 'return-from)6932 (p2-return-from form target representation))6933 (t6934 (assert (not "jump-node: can't happen"))))))6935 ((block-node-p form)6936 (p2-block-node form target representation))6937 ((let/let*-node-p form)6938 (p2-let/let*-node form target representation))6939 ((tagbody-node-p form)6940 (p2-tagbody-node form target)6941 (fix-boxing representation nil))6942 ((unwind-protect-node-p form)6943 (p2-unwind-protect-node form target)6944 (fix-boxing representation nil))6945 ((m-v-b-node-p form)6946 (p2-m-v-b-node form target)6947 (fix-boxing representation nil))6948 ((flet-node-p form)6949 (p2-flet-node form target representation))6950 ((labels-node-p form)6951 (p2-labels-node form target representation))6952 ((locally-node-p form)6953 (p2-locally-node form target representation))6954 ((catch-node-p form)6955 (p2-catch-node form target)6956 (fix-boxing representation nil))6957 ((progv-node-p form)6958 (p2-progv-node form target representation))6959 ((synchronized-node-p form)6960 (p2-threads-synchronized-on form target)6961 (fix-boxing representation nil))6962 (t6963 (aver (not "Can't happen")))6964 ))6965 6966 6967 6968 6884 (cond 6885 ((consp form) 6886 (let* ((op (%car form)) 6887 (handler (and (symbolp op) (get op 'p2-handler)))) 6888 (cond 6889 (handler 6890 (funcall handler form target representation)) 6891 ((symbolp op) 6892 (cond 6893 ((special-operator-p op) 6894 (dformat t "form = ~S~%" form) 6895 (compiler-unsupported 6896 "COMPILE-FORM: unsupported special operator ~S" op)) 6897 (t 6898 (compile-function-call form target representation)))) 6899 ((and (consp op) (eq (%car op) 'LAMBDA)) 6900 (aver (progn 'unexpected-lambda nil)) 6901 (let ((new-form (list* 'FUNCALL form))) 6902 (compile-form new-form target representation))) 6903 (t 6904 (compiler-unsupported "COMPILE-FORM unhandled case ~S" form))))) 6905 ((symbolp form) 6906 (cond 6907 ((null form) 6908 (emit-push-false representation) 6909 (emit-move-from-stack target representation)) 6910 ((eq form t) 6911 (emit-push-true representation) 6912 (emit-move-from-stack target representation)) 6913 ((keywordp form) 6914 (ecase representation 6915 (:boolean 6916 (emit 'iconst_1)) 6917 ((nil) 6918 (emit-load-externalized-object form))) 6919 (emit-move-from-stack target representation)) 6920 (t 6921 ;; Shouldn't happen. 6922 (aver nil)))) 6923 ((var-ref-p form) 6924 (compile-var-ref form target representation)) 6925 ((node-p form) 6926 (cond 6927 ((jump-node-p form) 6928 (let ((op (car (node-form form)))) 6929 (cond 6930 ((eq op 'go) 6931 (p2-go form target representation)) 6932 ((eq op 'return-from) 6933 (p2-return-from form target representation)) 6934 (t 6935 (assert (not "jump-node: can't happen")))))) 6936 ((block-node-p form) 6937 (p2-block-node form target representation)) 6938 ((let/let*-node-p form) 6939 (p2-let/let*-node form target representation)) 6940 ((tagbody-node-p form) 6941 (p2-tagbody-node form target) 6942 (fix-boxing representation nil)) 6943 ((unwind-protect-node-p form) 6944 (p2-unwind-protect-node form target) 6945 (fix-boxing representation nil)) 6946 ((m-v-b-node-p form) 6947 (p2-m-v-b-node form target) 6948 (fix-boxing representation nil)) 6949 ((flet-node-p form) 6950 (p2-flet-node form target representation)) 6951 ((labels-node-p form) 6952 (p2-labels-node form target representation)) 6953 ((locally-node-p form) 6954 (p2-locally-node form target representation)) 6955 ((catch-node-p form) 6956 (p2-catch-node form target) 6957 (fix-boxing representation nil)) 6958 ((progv-node-p form) 6959 (p2-progv-node form target representation)) 6960 ((synchronized-node-p form) 6961 (p2-threads-synchronized-on form target) 6962 (fix-boxing representation nil)) 6963 (t 6964 (aver (not "Can't happen"))))) 6965 ((constantp form) 6966 (compile-constant form target representation)) 6967 (t 6968 (compiler-unsupported "COMPILE-FORM unhandled case ~S" form))) 6969 6969 t) 6970 6970
Note: See TracChangeset
for help on using the changeset viewer.