@@ -19,7 +19,7 @@ call_result_unused(si::StmtInfo) = !si.used
19
19
20
20
function get_max_methods (mod:: Module , interp:: AbstractInterpreter )
21
21
max_methods = ccall (:jl_get_module_max_methods , Cint, (Any,), mod) % Int
22
- max_methods < 0 ? InferenceParams (interp). MAX_METHODS : max_methods
22
+ max_methods < 0 ? InferenceParams (interp). max_methods : max_methods
23
23
end
24
24
25
25
function get_max_methods (@nospecialize (f), mod:: Module , interp:: AbstractInterpreter )
@@ -62,7 +62,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f),
62
62
# no overlayed calls, try an additional effort now to check if this call
63
63
# isn't overlayed rather than just handling it conservatively
64
64
matches = find_matching_methods (arginfo. argtypes, atype, method_table (interp),
65
- InferenceParams (interp). MAX_UNION_SPLITTING , max_methods)
65
+ InferenceParams (interp). max_union_splitting , max_methods)
66
66
if ! isa (matches, FailedMethodMatch)
67
67
nonoverlayed = matches. nonoverlayed
68
68
end
@@ -78,7 +78,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f),
78
78
79
79
argtypes = arginfo. argtypes
80
80
matches = find_matching_methods (argtypes, atype, method_table (interp),
81
- InferenceParams (interp). MAX_UNION_SPLITTING , max_methods)
81
+ InferenceParams (interp). max_union_splitting , max_methods)
82
82
if isa (matches, FailedMethodMatch)
83
83
add_remark! (interp, sv, matches. reason)
84
84
return CallMeta (Any, Effects (), NoCallInfo ())
@@ -122,7 +122,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f),
122
122
splitunions = false
123
123
# TODO : this used to trigger a bug in inference recursion detection, and is unmaintained now
124
124
# sigtuple = unwrap_unionall(sig)::DataType
125
- # splitunions = 1 < unionsplitcost(sigtuple.parameters) * napplicable <= InferenceParams(interp).MAX_UNION_SPLITTING
125
+ # splitunions = 1 < unionsplitcost(sigtuple.parameters) * napplicable <= InferenceParams(interp).max_union_splitting
126
126
if splitunions
127
127
splitsigs = switchtupleunion (sig)
128
128
for sig_n in splitsigs
276
276
any_ambig (m:: UnionSplitMethodMatches ) = any (any_ambig, m. info. matches)
277
277
278
278
function find_matching_methods (argtypes:: Vector{Any} , @nospecialize (atype), method_table:: MethodTableView ,
279
- union_split :: Int , max_methods:: Int )
279
+ max_union_splitting :: Int , max_methods:: Int )
280
280
# NOTE this is valid as far as any "constant" lattice element doesn't represent `Union` type
281
- if 1 < unionsplitcost (argtypes) <= union_split
281
+ if 1 < unionsplitcost (argtypes) <= max_union_splitting
282
282
split_argtypes = switchtupleunion (argtypes)
283
283
infos = MethodMatchInfo[]
284
284
applicable = Any[]
@@ -599,7 +599,7 @@ function abstract_call_method(interp::AbstractInterpreter, method::Method, @nosp
599
599
end
600
600
601
601
# see if the type is actually too big (relative to the caller), and limit it if required
602
- newsig = limit_type_size (sig, comparison, hardlimit ? comparison : sv. linfo. specTypes, InferenceParams (interp). TUPLE_COMPLEXITY_LIMIT_DEPTH , spec_len)
602
+ newsig = limit_type_size (sig, comparison, hardlimit ? comparison : sv. linfo. specTypes, InferenceParams (interp). tuple_complexity_limit_depth , spec_len)
603
603
604
604
if newsig != = sig
605
605
# continue inference, but note that we've limited parameter complexity
@@ -641,7 +641,7 @@ function abstract_call_method(interp::AbstractInterpreter, method::Method, @nosp
641
641
# while !(newsig in seen)
642
642
# push!(seen, newsig)
643
643
# lsig = length((unwrap_unionall(sig)::DataType).parameters)
644
- # newsig = limit_type_size(newsig, sig, sv.linfo.specTypes, InferenceParams(interp).TUPLE_COMPLEXITY_LIMIT_DEPTH , lsig)
644
+ # newsig = limit_type_size(newsig, sig, sv.linfo.specTypes, InferenceParams(interp).tuple_complexity_limit_depth , lsig)
645
645
# recomputed = ccall(:jl_type_intersection_with_env, Any, (Any, Any), newsig, method.sig)::SimpleVector
646
646
# newsig = recomputed[2]
647
647
# end
@@ -1436,13 +1436,13 @@ function abstract_iteration(interp::AbstractInterpreter, @nospecialize(itft), @n
1436
1436
calls = CallMeta[call]
1437
1437
stateordonet_widened = widenconst (stateordonet)
1438
1438
1439
- # Try to unroll the iteration up to MAX_TUPLE_SPLAT , which covers any finite
1439
+ # Try to unroll the iteration up to max_tuple_splat , which covers any finite
1440
1440
# length iterators, or interesting prefix
1441
1441
while true
1442
1442
if stateordonet_widened === Nothing
1443
1443
return ret, AbstractIterationInfo (calls)
1444
1444
end
1445
- if Nothing <: stateordonet_widened || length (ret) >= InferenceParams (interp). MAX_TUPLE_SPLAT
1445
+ if Nothing <: stateordonet_widened || length (ret) >= InferenceParams (interp). max_tuple_splat
1446
1446
break
1447
1447
end
1448
1448
if ! isa (stateordonet_widened, DataType) || ! (stateordonet_widened <: Tuple ) || isvatuple (stateordonet_widened) || length (stateordonet_widened. parameters) != 2
@@ -1520,7 +1520,7 @@ function abstract_apply(interp::AbstractInterpreter, argtypes::Vector{Any}, si::
1520
1520
end
1521
1521
res = Union{}
1522
1522
nargs = length (aargtypes)
1523
- splitunions = 1 < unionsplitcost (aargtypes) <= InferenceParams (interp). MAX_APPLY_UNION_ENUM
1523
+ splitunions = 1 < unionsplitcost (aargtypes) <= InferenceParams (interp). max_apply_union_enum
1524
1524
ctypes = [Any[aft]]
1525
1525
infos = Vector{MaybeAbstractIterationInfo}[MaybeAbstractIterationInfo[]]
1526
1526
effects = EFFECTS_TOTAL
@@ -1728,14 +1728,14 @@ function abstract_call_builtin(interp::AbstractInterpreter, f::Builtin, (; fargs
1728
1728
a = ssa_def_slot (fargs[2 ], sv)
1729
1729
a2 = argtypes[2 ]
1730
1730
if isa (a, SlotNumber)
1731
- cndt = isa_condition (a2, argtypes[3 ], InferenceParams (interp). MAX_UNION_SPLITTING , rt)
1731
+ cndt = isa_condition (a2, argtypes[3 ], InferenceParams (interp). max_union_splitting , rt)
1732
1732
if cndt != = nothing
1733
1733
return Conditional (a, cndt. thentype, cndt. elsetype)
1734
1734
end
1735
1735
end
1736
1736
if isa (a2, MustAlias)
1737
1737
if ! isa (rt, Const) # skip refinement when the field is known precisely (just optimization)
1738
- cndt = isa_condition (a2, argtypes[3 ], InferenceParams (interp). MAX_UNION_SPLITTING )
1738
+ cndt = isa_condition (a2, argtypes[3 ], InferenceParams (interp). max_union_splitting )
1739
1739
if cndt != = nothing
1740
1740
return form_mustalias_conditional (a2, cndt. thentype, cndt. elsetype)
1741
1741
end
@@ -1749,18 +1749,18 @@ function abstract_call_builtin(interp::AbstractInterpreter, f::Builtin, (; fargs
1749
1749
# if doing a comparison to a singleton, consider returning a `Conditional` instead
1750
1750
if isa (aty, Const)
1751
1751
if isa (b, SlotNumber)
1752
- cndt = egal_condition (aty, bty, InferenceParams (interp). MAX_UNION_SPLITTING , rt)
1752
+ cndt = egal_condition (aty, bty, InferenceParams (interp). max_union_splitting , rt)
1753
1753
return Conditional (b, cndt. thentype, cndt. elsetype)
1754
1754
elseif isa (bty, MustAlias) && ! isa (rt, Const) # skip refinement when the field is known precisely (just optimization)
1755
- cndt = egal_condition (aty, bty. fldtyp, InferenceParams (interp). MAX_UNION_SPLITTING )
1755
+ cndt = egal_condition (aty, bty. fldtyp, InferenceParams (interp). max_union_splitting )
1756
1756
return form_mustalias_conditional (bty, cndt. thentype, cndt. elsetype)
1757
1757
end
1758
1758
elseif isa (bty, Const)
1759
1759
if isa (a, SlotNumber)
1760
- cndt = egal_condition (bty, aty, InferenceParams (interp). MAX_UNION_SPLITTING , rt)
1760
+ cndt = egal_condition (bty, aty, InferenceParams (interp). max_union_splitting , rt)
1761
1761
return Conditional (a, cndt. thentype, cndt. elsetype)
1762
1762
elseif isa (aty, MustAlias) && ! isa (rt, Const) # skip refinement when the field is known precisely (just optimization)
1763
- cndt = egal_condition (bty, aty. fldtyp, InferenceParams (interp). MAX_UNION_SPLITTING )
1763
+ cndt = egal_condition (bty, aty. fldtyp, InferenceParams (interp). max_union_splitting )
1764
1764
return form_mustalias_conditional (aty, cndt. thentype, cndt. elsetype)
1765
1765
end
1766
1766
end
0 commit comments