elide value cells for NLXs when it seems like the right thing
commit3352e447d32d6786a5609cd53c6b3f2be7ab3e08
authorNikodemus Siivola <nikodemus@random-state.net>
Mon, 21 May 2012 20:30:54 +0000 (21 23:30 +0300)
committerNikodemus Siivola <nikodemus@random-state.net>
Sun, 27 May 2012 16:46:05 +0000 (27 19:46 +0300)
tree6dd5f8cc21385dce656c6df7cbb638c663fdf53e
parent2ad50715571eb8ccfb9ab55c13b8c038c89f2dfd
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.
src/compiler/physenvanal.lisp
tests/compiler.pure.lisp