Ignore:
Timestamp:
05/09/09 20:05:25 (15 years ago)
Author:
ehuelsmann
Message:

Local transfer of control with environment restoration
efficiency: don't save the environment on each block/tagbody start.

Only restore the environment when restoration is required,
using the value in the outermost block which saved an environment.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/jvm.lisp

    r11829 r11851  
    428428      (return t))))
    429429
     430(defknown environment-register-to-restore (&optional t) t)
     431(defun environment-register-to-restore (&optional outermost-block)
     432  "Returns the environment register which contains the
     433saved environment from the outermost enclosing block:
     434
     435That's the one which contains the environment used in the outermost block."
     436  (flet ((outermost-register (last-register block)
     437           (when (eq block outermost-block)
     438             (return-from environment-register-to-restore last-register))
     439           (or (block-environment-register block)
     440               last-register)))
     441    (reduce #'outermost-register *blocks*
     442            :initial-value nil)))
     443
    430444(defstruct tag
    431445  ;; The symbol (or integer) naming the tag
Note: See TracChangeset for help on using the changeset viewer.