@@ -360,8 +360,19 @@ function ir_inline_item!(compact::IncrementalCompact, idx::Int, argexprs::Vector
360
360
end
361
361
end
362
362
if ! validate_sparams (sparam_vals)
363
- sparam_vals = insert_node_here! (compact,
364
- effect_free (NewInstruction (Expr (:call , Core. _compute_sparams, item. mi. def, argexprs... ), SimpleVector, topline)))
363
+ if def. isva
364
+ nonva_args = argexprs[1 : end - 1 ]
365
+ va_arg = argexprs[end ]
366
+ tuple_call = Expr (:call , TOP_TUPLE, def, nonva_args... )
367
+ tuple_type = tuple_tfunc ([argextype (arg, compact) for arg in nonva_args])
368
+ tupl = insert_node_here! (compact, NewInstruction (tuple_call, tuple_type, topline))
369
+ apply_iter_expr = Expr (:call , Core. _apply_iterate, iterate, Core. _compute_sparams, tupl, va_arg)
370
+ sparam_vals = insert_node_here! (compact,
371
+ effect_free (NewInstruction (apply_iter_expr, SimpleVector, topline)))
372
+ else
373
+ sparam_vals = insert_node_here! (compact,
374
+ effect_free (NewInstruction (Expr (:call , Core. _compute_sparams, def, argexprs... ), SimpleVector, topline)))
375
+ end
365
376
end
366
377
# If the iterator already moved on to the next basic block,
367
378
# temporarily re-open in again.
@@ -458,7 +469,8 @@ function fix_va_argexprs!(compact::IncrementalCompact,
458
469
push! (tuple_typs, argextype (arg, compact))
459
470
end
460
471
tuple_typ = tuple_tfunc (tuple_typs)
461
- push! (newargexprs, insert_node_here! (compact, NewInstruction (tuple_call, tuple_typ, line_idx)))
472
+ tuple_inst = NewInstruction (tuple_call, tuple_typ, line_idx)
473
+ push! (newargexprs, insert_node_here! (compact, tuple_inst))
462
474
return newargexprs
463
475
end
464
476
@@ -1239,7 +1251,7 @@ function analyze_single_call!(
1239
1251
local any_fully_covered = false
1240
1252
local handled_all_cases = true
1241
1253
local revisit_idx = nothing
1242
- local only_method = nothing
1254
+ local only_method = nothing # tri-valued: nothing if unknown, false if proven untrue, otherwise the method itself
1243
1255
local meth:: MethodLookupResult
1244
1256
for i in 1 : length (infos)
1245
1257
meth = infos[i]. results
@@ -1443,9 +1455,7 @@ function inline_const_if_inlineable!(inst::Instruction)
1443
1455
end
1444
1456
1445
1457
function assemble_inline_todo! (ir:: IRCode , state:: InliningState )
1446
- # todo = (inline_idx, (isva, isinvoke, na), method, spvals, inline_linetable, inline_ir, lie)
1447
1458
todo = Pair{Int, Any}[]
1448
- et = state. et
1449
1459
1450
1460
for idx in 1 : length (ir. stmts)
1451
1461
simpleres = process_simple! (ir, idx, state, todo)
0 commit comments