Changeset 11873


Ignore:
Timestamp:
05/15/09 19:32:01 (9 years ago)
Author:
ehuelsmann
Message:

Don't use local function variables for FLET,
not even in case of closures (reduces complexity
in the compiler).

Location:
trunk/abcl/src/org/armedbear/lisp
Files:
2 edited

Legend:

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

    r11850 r11873  
    592592      form local-functions lambda-list name body
    593593      ((let ((local-function (make-local-function :name name
    594             :compiland compiland)))
     594                                                  :compiland compiland)))
    595595   (multiple-value-bind (body decls) (parse-body body)
    596596     (let* ((block-name (fdefinition-block-name name))
     
    605605       (generate-inline-expansion block-name lambda-list body))
    606606       (p1-compiland compiland)))
    607    (when *closure-variables*
    608      (let ((variable (make-variable :name (gensym))))
    609        (setf (local-function-variable local-function) variable)
    610        (push variable *all-variables*)))
    611607   (push local-function local-functions)))
    612608      ((with-saved-compiler-policy
  • trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp

    r11872 r11873  
    48474847
    48484848
    4849 (defun emit-make-compiled-closure-for-flet/labels 
     4849(defun emit-make-compiled-closure-for-flet/labels
    48504850    (local-function compiland declaration)
    48514851  (emit 'getstatic *this-class* declaration +lisp-object+)
     
    48734873    (unless (ignore-errors (load-compiled-function pathname))
    48744874      (error "Unable to load ~S." pathname))))
    4875  
     4875
    48764876(defknown p2-flet-process-compiland (t) t)
    48774877(defun p2-flet-process-compiland (local-function)
     
    48844884       (set-compiland-and-write-class-file class-file compiland)
    48854885       (verify-class-file-loadable pathname)
    4886              (setf (local-function-class-file local-function) class-file))
    4887            (when (local-function-variable local-function)
    4888              (let ((g (declare-local-function local-function)))
    4889          (emit-make-compiled-closure-for-flet/labels
    4890     local-function compiland g))))
     4886             (setf (local-function-class-file local-function) class-file)))
    48914887          (t
    4892      (with-temp-class-file 
     4888     (with-temp-class-file
    48934889         pathname class-file lambda-list
    48944890         (set-compiland-and-write-class-file class-file compiland)
    48954891         (setf (local-function-class-file local-function) class-file)
    48964892         (setf (local-function-function local-function)
    4897                      (load-compiled-function pathname))
    4898          (when (local-function-variable local-function)
    4899      (let ((g (declare-object (load-compiled-function pathname))))
    4900        (emit-make-compiled-closure-for-flet/labels
    4901         local-function compiland g))))))))
     4893                     (load-compiled-function pathname)))))))
    49024894
    49034895(defknown p2-labels-process-compiland (t) t)
     
    49134905             (setf (local-function-class-file local-function) class-file)
    49144906             (let ((g (declare-local-function local-function)))
    4915          (emit-make-compiled-closure-for-flet/labels 
     4907         (emit-make-compiled-closure-for-flet/labels
    49164908    local-function compiland g))))
    49174909          (t
     
    49214913         (setf (local-function-class-file local-function) class-file)
    49224914         (let ((g (declare-object (load-compiled-function pathname))))
    4923      (emit-make-compiled-closure-for-flet/labels 
     4915     (emit-make-compiled-closure-for-flet/labels
    49244916      local-function compiland g)))))))
    49254917
     
    49324924        (local-functions (cadr form))
    49334925        (body (cddr form)))
    4934     (dolist (local-function local-functions)
    4935       (let ((variable (local-function-variable local-function)))
    4936         (when variable
    4937           (aver (null (variable-register variable)))
    4938           (unless (variable-closure-index variable)
    4939             (setf (variable-register variable) (allocate-register))))))
    49404926    (dolist (local-function local-functions)
    49414927      (p2-flet-process-compiland local-function))
Note: See TracChangeset for help on using the changeset viewer.