Changeset 15580
- Timestamp:
- 05/23/22 06:23:39 (10 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/compile-file.lisp
r15569 r15580 74 74 (setf (char name i) #\_))) 75 75 name)) 76 76 77 77 78 78 (declaim (ftype (function () t) next-classfile)) … … 107 107 (return-from verify-load nil)) 108 108 (with-open-file (cf classfile :direction :input) 109 (when 109 (when 110 110 (= 0 (file-length cf)) 111 111 ;;; TODO hook into a real ABCL compiler condition hierarchy … … 205 205 ;; TODO (annotate form toplevel-form classfile compiled-function fasl-class-number) 206 206 ;;; ??? define an API by perhaps exporting these symbols? 207 (setf (getf form 'form-source) 207 (setf (getf form 'form-source) 208 208 toplevel-form 209 210 (getf form 'classfile) 209 210 (getf form 'classfile) 211 211 classfile 212 213 (getf form 'compiled-function) 212 213 (getf form 'compiled-function) 214 214 compiled-function 215 216 (getf form 'class-number) 215 216 (getf form 'class-number) 217 217 saved-class-number)) 218 218 (setf form … … 323 323 (cl:get ',sym 'sys::source nil)))))) 324 324 325 325 326 326 (declaim (ftype (function (t t t) t) process-toplevel-mop.ensure-method)) 327 327 (defun process-toplevel-mop.ensure-method (form stream compile-time-too) … … 393 393 :element-type ',(array-element-type initial-value) 394 394 :initial-contents ',(coerce initial-value 'list)))) 395 `(progn 395 `(progn 396 396 (sys:put ',name 'sys::source 397 397 (cl:cons … … 497 497 when (eq (car method-form) :method) 498 498 collect 499 (multiple-value-bind (function-name qualifiers lambda-list specializers documentation declarations body) 499 (multiple-value-bind (function-name qualifiers lambda-list specializers documentation declarations body) 500 500 (mop::parse-defmethod `(,(second form) ,@(rest method-form))) 501 501 ;;; FIXME: style points for refactoring double backquote to "normal" form … … 604 604 (cl:cons '((:function ,name) 605 605 ,(namestring *source*) ,*source-position*) 606 (cl:get ',sym 'sys::source nil))) 606 (cl:get ',sym 'sys::source nil))) 607 607 (sys:fset ',name 608 608 (sys::get-fasl-function *fasl-loader* … … 640 640 (push name *toplevel-functions*) 641 641 (when (and (consp name) 642 (or 642 (or 643 643 (eq 'setf (first name)) 644 644 (eq 'cl:setf (first name)))) … … 700 700 (when (and (symbolp operator) 701 701 (macro-function operator *compile-file-environment*)) 702 (when (eq operator 'define-setf-expander) 702 (when (eq operator 'define-setf-expander) 703 703 (push (second form) *toplevel-setf-expanders*)) 704 (when (and (eq operator 'defsetf) 704 (when (and (eq operator 'defsetf) 705 705 (consp (third form))) ;; long form of DEFSETF 706 706 (push (second form) *toplevel-setf-expanders*)) … … 742 742 (translate-logical-pathname output-file) 743 743 output-file)) 744 (zipfile 744 (zipfile 745 745 (if (find :windows *features*) 746 746 (make-pathname :defaults output-file :type type) … … 783 783 784 784 (defun write-fasl-prologue (stream in-package) 785 "Write the forms that form the fasl to STREAM. 786 787 The last form will use IN-PACKAGE to set the *package* to its value when 785 "Write the forms that form the fasl to STREAM. 786 787 The last form will use IN-PACKAGE to set the *package* to its value when 788 788 COMPILE-FILE was invoked." 789 789 (let ((out stream) … … 824 824 (defun compile-from-stream (in output-file temp-file temp-file2 825 825 extract-toplevel-funcs-and-macros 826 functions-file macros-file exports-file 826 functions-file macros-file exports-file 827 827 setf-functions-file setf-expanders-file) 828 828 (let* ((*compile-file-pathname* (make-pathname :defaults (pathname in) … … 855 855 (jvm::with-file-compilation 856 856 (handler-bind 857 ((style-warning 857 ((style-warning 858 858 #'(lambda (c) 859 859 (setf warnings-p t) … … 876 876 (when (eq form in) 877 877 (return)) 878 (process-toplevel-form form out nil)))) 878 (if (>= (length (format nil "~a" form)) 65536) 879 ;; Following the solution propose here: 880 ;; see https://github.com/armedbear/abcl/issues/246#issuecomment-698854437 881 ;; just include the offending interpreted form in the loader 882 ;; using it instead of the compiled representation 883 (write (ext:macroexpand-all form *compile-file-environment*) 884 :stream out) 885 (process-toplevel-form form out nil)) 886 ))) 879 887 (finalize-fasl-output) 880 888 (dolist (name *fbound-names*) … … 1042 1050 (compile-from-stream in output-file temp-file temp-file2 1043 1051 extract-toplevel-funcs-and-macros 1044 functions-file macros-file exports-file 1052 functions-file macros-file exports-file 1045 1053 setf-functions-file setf-expanders-file) 1046 1054 (values (truename output-file) warnings-p failure-p))))))
Note: See TracChangeset
for help on using the changeset viewer.