Changeset 11523


Ignore:
Timestamp:
01/02/09 17:04:19 (12 years ago)
Author:
vvoutilainen
Message:

Macro for temp files in p2-flet/labels-process-compiland.
At the same time, make the helper function parameter's
name sane.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp

    r11522 r11523  
    47534753
    47544754
    4755 (defun emit-make-compiled-closure-for-flet/labels (local-function compiland g)
    4756   (emit 'getstatic *this-class* g +lisp-object+)
     4755(defun emit-make-compiled-closure-for-flet/labels
     4756    (local-function compiland declaration)
     4757  (emit 'getstatic *this-class* declaration +lisp-object+)
    47574758  (let ((parent (compiland-parent compiland)))
    47584759    (when (compiland-closure-register parent)
     
    47654766       +lisp-object+)))
    47664767  (emit 'var-set (local-function-variable local-function)))
     4768
     4769(defmacro with-temp-class-file (pathname class-file lambda-list &body body)
     4770  `(let* ((,pathname (make-temp-file))
     4771    (,class-file (make-class-file :pathname ,pathname
     4772               :lambda-list ,lambda-list)))
     4773     (unwind-protect
     4774    (progn ,@body)
     4775       (delete-file pathname))))
    47674776
    47684777
     
    47874796    local-function compiland g))))
    47884797          (t
    4789            (let* ((pathname (make-temp-file))
    4790                   (class-file (make-class-file :pathname pathname
    4791                                                :lambda-list lambda-list)))
    4792              (unwind-protect
    4793                  (progn
    4794        (set-compiland-and-write-class-file class-file compiland)
    4795                    (setf (local-function-class-file local-function) class-file)
    4796                    (setf (local-function-function local-function) (load-compiled-function pathname))
    4797 
    4798                    (when (local-function-variable local-function)
    4799                      (let ((g (declare-object (load-compiled-function pathname))))
    4800            (emit-make-compiled-closure-for-flet/labels
    4801       local-function compiland g))))
    4802          (delete-file pathname)))))))
     4798     (with-temp-class-file
     4799         pathname class-file lambda-list
     4800         (set-compiland-and-write-class-file class-file compiland)
     4801         (setf (local-function-class-file local-function) class-file)
     4802         (setf (local-function-function local-function) (load-compiled-function pathname))
     4803         (when (local-function-variable local-function)
     4804     (let ((g (declare-object (load-compiled-function pathname))))
     4805       (emit-make-compiled-closure-for-flet/labels
     4806        local-function compiland g))))))))
    48034807
    48044808(defknown p2-labels-process-compiland (t) t)
     
    48204824    local-function compiland g))))
    48214825          (t
    4822            (let* ((pathname (make-temp-file))
    4823                   (class-file (make-class-file :pathname pathname
    4824                                                :lambda-list lambda-list)))
    4825              (unwind-protect
    4826                  (progn
    4827        (set-compiland-and-write-class-file class-file compiland)
    4828                    (setf (local-function-class-file local-function) class-file)
    4829                    (let ((g (declare-object (load-compiled-function pathname))))
    4830          (emit-make-compiled-closure-for-flet/labels
    4831           local-function compiland g)))
    4832                (delete-file pathname)))))))
     4826     (with-temp-class-file
     4827         pathname class-file lambda-list
     4828         (set-compiland-and-write-class-file class-file compiland)
     4829         (setf (local-function-class-file local-function) class-file)
     4830         (let ((g (declare-object (load-compiled-function pathname))))
     4831     (emit-make-compiled-closure-for-flet/labels
     4832      local-function compiland g)))))))
    48334833
    48344834(defknown p2-flet (t t t) t)
Note: See TracChangeset for help on using the changeset viewer.