@@ -27,7 +27,7 @@ import ._TOP_MOD: # Base definitions
27
27
pop!, push!, pushfirst!, empty!, delete!, max, min, enumerate, unwrap_unionall,
28
28
ismutabletype
29
29
import Core. Compiler: # Core.Compiler specific definitions
30
- Bottom, InferenceResult, IRCode, IR_FLAG_NOTHROW,
30
+ Bottom, OptimizerLattice, InferenceResult, IRCode, IR_FLAG_NOTHROW,
31
31
isbitstype, isexpr, is_meta_expr_head, println, widenconst, argextype, singleton_type,
32
32
fieldcount_noerror, try_compute_field, try_compute_fieldidx, hasintersect, ⊑ ,
33
33
intrinsic_nothrow, array_builtin_common_typecheck, arrayset_typecheck,
@@ -1596,12 +1596,16 @@ function escape_builtin!(::typeof(setfield!), astate::AnalysisState, pc::Int, ar
1596
1596
add_escape_change! (astate, val, ssainfo)
1597
1597
# compute the throwness of this setfield! call here since builtin_nothrow doesn't account for that
1598
1598
@label add_thrown_escapes
1599
- argtypes = Any[]
1600
- for i = 2 : length (args)
1601
- push! (argtypes, argextype (args[i], ir))
1599
+ if length (args) == 4 && setfield!_nothrow (OptimizerLattice (),
1600
+ argextype (args[2 ], ir), argextype (args[3 ], ir), argextype (args[4 ], ir))
1601
+ return true
1602
+ elseif length (args) == 3 && setfield!_nothrow (OptimizerLattice (),
1603
+ argextype (args[2 ], ir), argextype (args[3 ], ir))
1604
+ return true
1605
+ else
1606
+ add_thrown_escapes! (astate, pc, args, 2 )
1607
+ return true
1602
1608
end
1603
- setfield!_nothrow (argtypes) || add_thrown_escapes! (astate, pc, args, 2 )
1604
- return true
1605
1609
end
1606
1610
1607
1611
function escape_builtin! (:: typeof (arrayref), astate:: AnalysisState , pc:: Int , args:: Vector{Any} )
0 commit comments