You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
invoked calls: record invoke signature in backedges (#46010)
This fixes a long-standing issue with how we've handled `invoke` calls
with respect to method invalidation. When we load a package, we need
to ask whether a given MethodInstance would be compiled in the same
way now (aka, in the user's running session) as when the package was
precompiled; in practice, the way we do that is to test whether the
dispatches would be to the same methods in the current
world-age. `invoke` presents special challenges because it allows the
coder to deliberately select a different method than the one that
would be chosen by ordinary dispatch; if there is no record of how
this choice was made, it can look like it resolves to the wrong method
and this can trigger invalidation.
This allows a MethodInstance to store dispatch tuples as well as other
MethodInstances among their backedges.
Additionally:
- provide backedge-iterators for both C and Julia that abstracts
the specific storage mechanism.
- fix a bug in the CodeInstance `relocatability` field, where methods
that only return a constant (and hence store `nothing` for
`inferred`) were deemed non-relocatable.
- fix a bug in which #43990 should have checked that the method had
not been deleted. Tests passed formerly simply because we weren't
caching external CodeInstances that inferred down to a `Const`;
fixing that exposed the bug. This bug has been exposed since
merging #43990 for non-`Const` inference, and would affect Revise
etc.
Co-authored-by: Jameson Nash <vtjnash@gmail.com>
0 commit comments