Skip to content

Entry points - #1860

Merged
Bike merged 14 commits into
mainfrom
entry-points
Sep 15, 2026
Merged

Bike merged 14 commits into
mainfrom
entry-points

Conversation

@Bike

@Bike Bike commented Sep 15, 2026

Copy link
Copy Markdown
Member

Uses the new Cleavir entry points stuff where we explicitly mark what functions are actually used externally, rather than relying on no local calls + no enclose which is goofy. This lets us eliminate any functions that turn out to be unused.

The other thing in this PR is fixing up the local call machinery to use the normal argument machinery, so that local calls are never translated as creating a closure, even for hairy lambda lists. This allows much hairier local calls.

Most of this code is cannibalized from my inlining branch from a few months back. Will have to get back to that, but nothing in this PR is directly about inlining, at least on the Lisp level.

Bike added 14 commits September 14, 2026 13:56
rather than a function. This will let us compile
wrong-number-of-arguments errors even in cases where we don't make
an actual function (because the function is only locally called).
this should be slightly faster, but the main importance here is
that it means we won't need a XEP or function.
This means we don't need closures for multiple value local calls.
Plus we can remove some code duplication and just use the normal
argument parser, yahoo.
This will be an important property for inlining, because it means
we can introduce any functions we want without requiring new
functions in the fasl literals.

It also saves a little runtime consing.
We have to mark entry points in b2b now. And, we can use entry-point-p
instead of treating "no local calls or enclose" as being an entry point.
compiling closures is weird and Cleavir is not really set up for
it. Without this recursive marking, you can compile a closure, and
the function that closes over it can be deleted as it is not an
entry point. That deletes the variables, which messes up the
functions' environments so they don't close correctly.
We'd need some kind of notion of a variable attached to a module
rather than a function, I guess, and even then there would be more
problems with a closure over an exit point. So here's a kludge
that should work, it just keeps more functions alive than it
needs to.
see comment. The point is this saves having to compile the DEFUN
garbage that is very common in bytecode.
@Bike
Bike merged commit 67f606a into main Sep 15, 2026
6 checks passed
@Bike
Bike deleted the entry-points branch September 15, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant