Skip to content

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
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.

@vtjnash
Copy link
Member

vtjnash commented Nov 18, 2024

No longer relevant, due to #54654 which may allow all bindings to be redefined and none to be permanent anymore

@vtjnash vtjnash closed this Nov 18, 2024
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