@@ -122,23 +122,23 @@ function invalidate_code_for_globalref!(b::Core.Binding, invalidated_bpart::Core
122
122
invalidated_any |= invalidate_method_for_globalref! (gr, method, invalidated_bpart, new_max_world)
123
123
end
124
124
end
125
- if isdefined (b, :backedges )
126
- for edge in b. backedges
127
- if isa (edge, CodeInstance)
128
- ccall (:jl_invalidate_code_instance , Cvoid, (Any, UInt), edge, new_max_world)
129
- invalidated_any = true
130
- elseif isa (edge, Core. Binding)
131
- isdefined (edge, :partitions ) || continue
132
- latest_bpart = edge. partitions
133
- latest_bpart. max_world == typemax (UInt) || continue
134
- is_some_imported (binding_kind (latest_bpart)) || continue
135
- if is_some_binding_imported (binding_kind (latest_bpart))
136
- partition_restriction (latest_bpart) === b || continue
137
- end
138
- push! (queued_bindings, (edge, latest_bpart, latest_bpart))
139
- else
140
- invalidated_any |= invalidate_method_for_globalref! (gr, edge:: Method , invalidated_bpart, new_max_world)
125
+ nbackedges = ccall (:jl_binding_backedges_length , Csize_t, (Any,), b)
126
+ for i = 1 : nbackedges
127
+ edge = ccall (:jl_binding_backedges_getindex , Any, (Any, Csize_t), b, i)
128
+ if isa (edge, CodeInstance)
129
+ ccall (:jl_invalidate_code_instance , Cvoid, (Any, UInt), edge, new_max_world)
130
+ invalidated_any = true
131
+ elseif isa (edge, Core. Binding)
132
+ isdefined (edge, :partitions ) || continue
133
+ latest_bpart = edge. partitions
134
+ latest_bpart. max_world == typemax (UInt) || continue
135
+ is_some_imported (binding_kind (latest_bpart)) || continue
136
+ if is_some_binding_imported (binding_kind (latest_bpart))
137
+ partition_restriction (latest_bpart) === b || continue
141
138
end
139
+ push! (queued_bindings, (edge, latest_bpart, latest_bpart))
140
+ else
141
+ invalidated_any |= invalidate_method_for_globalref! (gr, edge:: Method , invalidated_bpart, new_max_world)
142
142
end
143
143
end
144
144
end
@@ -149,7 +149,7 @@ function invalidate_code_for_globalref!(b::Core.Binding, invalidated_bpart::Core
149
149
usings_backedges = ccall (:jl_get_module_usings_backedges , Any, (Any,), gr. mod)
150
150
if usings_backedges != = nothing
151
151
for user:: Module in usings_backedges:: Vector{Any}
152
- user_binding = ccall (:jl_get_module_binding_or_nothing , Any, (Any, Any), user, gr. name)
152
+ user_binding = ccall (:jl_get_module_binding_or_nothing , Any, (Any, Any), user, gr. name):: Union{Core.Binding, Nothing}
153
153
user_binding === nothing && continue
154
154
isdefined (user_binding, :partitions ) || continue
155
155
latest_bpart = user_binding. partitions
0 commit comments