-
Notifications
You must be signed in to change notification settings - Fork 112
backend: lazy closure restore #4895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: gabor/compile-tweaks
Are you sure you want to change the base?
Conversation
@@ -9125,6 +9125,9 @@ module VarEnv = struct | |||
in the given stackrep (Vanilla, UnboxedWord32, …) so far | |||
Used for immutable and mutable, non-captured data *) | |||
| Local of SR.t * int32 | |||
(* An already captured binding from the caller's frame | |||
Used for immutable and mutable, non-captured data *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used for immutable and mutable, non-captured data *) | |
Used for immutable and mutable data *) |
@@ -8971,6 +8971,9 @@ module VarEnv = struct | |||
in the given stackrep (Vanilla, UnboxedWord64, …) so far | |||
Used for immutable and mutable, non-captured data *) | |||
| Local of SR.t * int32 | |||
(* An already captured binding from the caller's frame | |||
Used for immutable and mutable, non-captured data *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used for immutable and mutable, non-captured data *) | |
Used for immutable and mutable data *) |
a5935df
to
47937ad
Compare
This might also reduce stack pressure - but won't it require repeated forwarding in the incremental gc? @luc-blaeser |
Definitely, it's a tradeoff. I expect it to be a total win when we just wrap an inner function (we can detect this in |
This gives us a les intrusive way of closure variable restoration. Instead of
one has
Some functions only use closed-over variables to pass them on to other closures! So it makes total sense to avoid pulling them into locals. Such functions arise from (non-inlined) local-
async
functions.Note: Right now this change is enabled globally, so I expect that the code size will increase due to closure variables used more than once. When we'll do this selectively, I expect a reduction in code size.