Commit [3352e4] Maximize Restore History

elide value cells for NLXs when it seems like the right thing

Previously we only did this for unsafe code.

Now we also elide them for

(1) exits from DX functions: if a DX function escapes its proper context,
trying to perform NLX to a stale tag is the least of our worries.

(2) functions that cannot escape. Since the escape analysis isn't yet very
tested, disable it for safe code, though. If this raises hairs on your
neck, consider this: even if our analysis is wrong, and a function we
didn't think could escape does, we're in the land of "undefined
consequences" anyways.

If you're wondering if this is worth it, compare

(defun feh (x)
(flet ((meh () (return-from feh 'meh)))
(typecase x
(cons (or (car x) (meh)))
(t (meh)))))

(time (loop repeat 10000 do (feh t)))

with and without the escape analysis.

Nikodemus Siivola Nikodemus Siivola 2012-05-21

changed src/compiler/physenvanal.lisp
changed tests/compiler.pure.lisp
src/compiler/physenvanal.lisp Diff Switch to side-by-side view
Loading...
tests/compiler.pure.lisp Diff Switch to side-by-side view
Loading...