Invalidate methods when binding is typed/const-defined #54733
+205
−27
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.
This allows for patterns like:
not to suffer a tremendous performance regression because of the fact that
foo
was inferred withbar
still undefined.This invalidation is not required for correctness, but for performance reasons once the global is defined we'd like to invalidate the code anyway to get an improved inference result:
Note: This is essentially an optimized implementation of the non-semantic portion of #54654 for the special case of untyped/undefined globals, and this should mostly be compatible with that PR. Compared to that change, this adds explicit edges so that invalidation can be significantly faster and bit more fine-grained.
TODO:
jl_binding_edges_t
to prevent corruption from concurrent accessbinding->ty
not to be reset on serialization (use the closed/open rules on type set instead)