Ignore:
Timestamp:
05/03/09 08:46:39 (14 years ago)
Author:
ehuelsmann
Message:

Small refactoring: introduce a centralized definition of
"enclosed by a block which associates extensive cleanup
with a transfer of control exception".

Also some reordering of functions in jvm.lisp.

File:
1 edited

Legend:

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

    r11818 r11819  
    44394439      (compile-progn-body body target representation))))
    44404440
    4441 (defknown find-tag (t) t)
    4442 (defun find-tag (name)
    4443   (dolist (tag *visible-tags*)
    4444     (when (eql name (tag-name tag))
    4445       (return tag))))
    4446 
    44474441(defknown p2-tagbody-node (t t) t)
    44484442(defun p2-tagbody-node (block target)
     
    45354529      ;; Local case.
    45364530      (let* ((tag-block (tag-block tag))
    4537              (register nil)
    4538              (protected
    4539               ;; Does the GO leave an enclosing CATCH or UNWIND-PROTECT?
    4540               (dolist (enclosing-block *blocks*)
    4541                 (when (eq enclosing-block tag-block)
    4542                   (return nil))
    4543                 (when (block-requires-non-local-exit-p enclosing-block)
    4544                   (return t)))))
    4545         (unless protected
     4531             (register nil))
     4532        (unless (enclosed-by-protected-block-p tag-block)
    45464533          (dolist (block *blocks*)
    45474534            (if (eq block tag-block)
     
    47234710        ;; Local case. Is the RETURN nested inside an UNWIND-PROTECT which is
    47244711        ;; inside the block we're returning from?
    4725         (let ((protected
    4726                (dolist (enclosing-block *blocks*)
    4727                  (when (eq enclosing-block block)
    4728                    (return nil))
    4729                  (when (block-requires-non-local-exit-p enclosing-block)
    4730                    (return t)))))
    4731           (unless protected
    4732             (unless (compiland-single-valued-p *current-compiland*)
     4712        (unless (enclosed-by-protected-block-p block)
     4713          (unless (compiland-single-valued-p *current-compiland*)
    47334714;;               (format t "compiland not single-valued: ~S~%"
    47344715;;                       (compiland-name *current-compiland*))
    4735               (emit-clear-values))
    4736             (compile-form result-form (block-target block) nil)
    4737             (emit 'goto (block-exit block))
    4738             (return-from p2-return-from)))))
     4716            (emit-clear-values))
     4717          (compile-form result-form (block-target block) nil)
     4718          (emit 'goto (block-exit block))
     4719          (return-from p2-return-from))))
    47394720    ;; Non-local RETURN.
    47404721    (aver (block-non-local-return-p block))
Note: See TracChangeset for help on using the changeset viewer.