Re: master: Allow the compile-evaluator to evaluate forms directly.

Stas Boukarev <[email protected]> Mon, 18 May 2026 17:58:56 +0300
Newsgroups gmane.lisp.steel-bank.cvs,gmane.lisp.steel-bank.devel
Message-ID <CAF63=11X_ZF_aymyo8_+jYRkSQNzPRG59bGRLqAfku3S3JiF3Q@mail.gmail.com>
(let () (compile nil `(lambda (x)
                                  (declare (optimize speed))
                                  (1+ x))))
stopped producing optimization notes.


On Mon, May 18, 2026 at 2:31 PM apache--- via Sbcl-commits
<[email protected]> wrote:
>
> The branch "master" has been updated in SBCL:
>        via  1f5238fe0b578e2a0ef201e851809c9ac9d3d862 (commit)
>       from  2720527dfadc6ab004d9e6778ed35743aaa59a76 (commit)
>
> - Log -----------------------------------------------------------------
> commit 1f5238fe0b578e2a0ef201e851809c9ac9d3d862
> Author: Charles Zhang <[email protected]>
> Date:   Thu Dec 15 12:09:51 2022 +0100
>
>     Allow the compile-evaluator to evaluate forms directly.
>
>     This change has the overall effect of having the evaluator properly
>     separate out top level code from any defined functions. See the new
>     test :EVAL-TOP-LEVEL-CODE-SEPARATE-COMPONENT and the existing tests
>     :STRUCTURE-SLOT-VALUE-IN-METHOD-NO-CALLEES and
>     :STRUCTURE-MISSING-SLOT-VALUE-IN-METHOD-SINGLE-CALLEE. As a bonus,
>     self call recognition works for COMPILE now. As a side effect,
>     we (correctly) get more redefinition warnings as well (for example for
>     WARN during bootstrap), which were missing before for some reason.
>
>     In order to achieve this, the following needs to be done:
>
>     * COMPILE does not have its own special way of doing ir1 conversion
>     for lambdas anymore, instead relying on the top level lambda machinery
>     to separate out the actual compiled code. This gives the correct
>     semantics for policy and compilation etc. for free without special or
>     duplicate logic, and removes all the stuff around
>     HAS-EXTERNAL-REFERENCES-P, which was an idea that was never really
>     finished. This allows us to extend COMPILE-IN-LEXENV to evaluate forms
>     directly and hence allow %SIMPLE-EVAL to not have to manually wrap the
>     lambdas either, so evaluation-via-compilation behaves like top-level
>     evaluation by the file compiler (of course without file compilation
>     semantics). LTV processing and fasteval also can just evaluate forms
>     directly with EVAL-WITH-COMPILE-IN-LEXENV.
>     * Storing source forms should always be off for PCL generated
>     functions, revealed by the clos-arena test. This was probably not
>     detected before because the policy inheritance was subtly wrong.
>     * Fix some tests to not rely on questionable behavior of how named
>     COMPILE interacts with global type information. Such behavior should
>     only work in compile file mode.
>     * The TL-XEP debug name had nothing to do with the actual TL-XEP
>     functional kind, which was confusing.
>     * TIME now counts all lambda conversions. Just ignoring the entry
>     points produced by COMPILE for the top level lambda didn't make much
>     sense since all other kinds of entry points get counted. It's there
>     purely to give a hint to the user how much work the compiler is doing,
>     not to count anything in the source being compiled.
>     * Core components need to have patch tables again. The fact that they
>     are exercised in warm bootstrap now means that we are likely actually
>     using the load time code stripping functionality not just in theory,
>     vut in practice as well.
>     * Add post ir1-toplevel processing smashing of names onto compiled
>     functions again to get names right. As an added bonus, this allows us
>     to get recognize self calls working for COMPILE functions.
>     * core debug source infos never actually used the function slot, and
>     it's not clear what function to give it when evaluating top level
>     forms, so delete it.
>     * Also fix > 3 decade old bug in MAKE-LISP-SOURCE-INFO in which a
>     plain vector was used when one with a fill pointer was expected. I
>     guess this code path hadn't been exercised in a long time.
> ---


_______________________________________________
Sbcl-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sbcl-commits