Entry points - #1860
Merged
Merged
Entry points#1860
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.