@@ -572,7 +572,7 @@ function abstract_call_method(interp::AbstractInterpreter, method::Method, @nosp
572
572
break
573
573
end
574
574
topmost === nothing || continue
575
- if edge_matches_sv (infstate, method, sig, sparams, hardlimit, sv)
575
+ if edge_matches_sv (interp, infstate, method, sig, sparams, hardlimit, sv)
576
576
topmost = infstate
577
577
edgecycle = true
578
578
end
@@ -680,12 +680,13 @@ function abstract_call_method(interp::AbstractInterpreter, method::Method, @nosp
680
680
return MethodCallResult (rt, edgecycle, edgelimited, edge, effects)
681
681
end
682
682
683
- function edge_matches_sv (frame:: InferenceState , method:: Method , @nospecialize (sig), sparams:: SimpleVector , hardlimit:: Bool , sv:: InferenceState )
683
+ function edge_matches_sv (interp :: AbstractInterpreter , frame:: InferenceState , method:: Method , @nospecialize (sig), sparams:: SimpleVector , hardlimit:: Bool , sv:: InferenceState )
684
684
# The `method_for_inference_heuristics` will expand the given method's generator if
685
685
# necessary in order to retrieve this field from the generated `CodeInfo`, if it exists.
686
686
# The other `CodeInfo`s we inspect will already have this field inflated, so we just
687
687
# access it directly instead (to avoid regeneration).
688
- callee_method2 = method_for_inference_heuristics (method, sig, sparams) # Union{Method, Nothing}
688
+ world = get_world_counter (interp)
689
+ callee_method2 = method_for_inference_heuristics (method, sig, sparams, world) # Union{Method, Nothing}
689
690
690
691
inf_method2 = frame. src. method_for_inference_limit_heuristics # limit only if user token match
691
692
inf_method2 isa Method || (inf_method2 = nothing )
@@ -722,11 +723,11 @@ function edge_matches_sv(frame::InferenceState, method::Method, @nospecialize(si
722
723
end
723
724
724
725
# This function is used for computing alternate limit heuristics
725
- function method_for_inference_heuristics (method:: Method , @nospecialize (sig), sparams:: SimpleVector )
726
- if isdefined (method, :generator ) && method. generator. expand_early && may_invoke_generator (method, sig, sparams)
726
+ function method_for_inference_heuristics (method:: Method , @nospecialize (sig), sparams:: SimpleVector , world :: UInt )
727
+ if isdefined (method, :generator ) && ! ( method. generator isa Core . GeneratedFunctionStub) && may_invoke_generator (method, sig, sparams)
727
728
method_instance = specialize_method (method, sig, sparams)
728
729
if isa (method_instance, MethodInstance)
729
- cinfo = get_staged (method_instance)
730
+ cinfo = get_staged (method_instance, world )
730
731
if isa (cinfo, CodeInfo)
731
732
method2 = cinfo. method_for_inference_limit_heuristics
732
733
if method2 isa Method
@@ -2060,7 +2061,7 @@ function most_general_argtypes(closure::PartialOpaque)
2060
2061
if ! isa (argt, DataType) || argt. name != = typename (Tuple)
2061
2062
argt = Tuple
2062
2063
end
2063
- return most_general_argtypes (closure. source, argt, false )
2064
+ return most_general_argtypes (closure. source, argt, #= withfirst =# false )
2064
2065
end
2065
2066
2066
2067
# call where the function is any lattice element
0 commit comments