Skip to content
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

Track "permanently defined" status for bindings #54728

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

topolarity
Copy link
Member

This change regains some inference power that we lost with #53750.

It adds an isdefined bit to all bindings to track whether they were defined when their module was open - if so, we can be sure that they will be defined forever.

This does not implement support for the atomic global ops, since those are far less common - this is a "best effort" bit, so it's only an inference/optimization impact if we fail to set it (in any case, no worse than the status quo today)

Similar to `is_opaque_closure`
This change regains some inference power that we lost with JuliaLang#53750. It
adds an `isdefined` bit to all bindings to track whether they were defined
when their module was open. If so, we can be sure that they will be defined
forever.
This code had not considered "mutation tearing", so the emitted
operations could be incorrect if any mutations were dropped.
@topolarity topolarity requested a review from vtjnash June 7, 2024 13:25
@Keno
Copy link
Member

Keno commented Jun 7, 2024

Needs tests, but also will stop working after #54654.

@topolarity
Copy link
Member Author

also will stop working after #54654.

Only the nothrow piece right? The static isdefined checks will still work?

Copy link
Sponsor Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not really acceptable to add cost to every global assignment call. We could put this into the staticdata serializer itself, but I think it remains to be shown that the loss of the isdefined/UndefRefError optimizations actually matters.

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.

3 participants