Skip to content

Commit 8b2d436

Browse files
committed
Specialize on small numbers of arguments for arrayref/arrayset
1 parent d0dff8e commit 8b2d436

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/generate_builtins.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,15 @@ function nargs(f, table, id)
2222
maxarg = typemax(Int)
2323
end
2424
# The tfunc tables are wrong for fptoui and fptosi (fixed in https://github.com/JuliaLang/julia/pull/30787)
25-
if f == "Base.fptoui" || f == "Base.fptosi"
25+
if f == Base.fptoui || f == Base.fptosi
2626
minarg = 2
2727
end
28+
# Specialize arrayref and arrayset for small numbers of arguments
29+
if f == Core.arrayref
30+
maxarg = 5
31+
elseif f == Core.arrayset
32+
maxarg = 6
33+
end
2834
return minarg, maxarg
2935
end
3036

0 commit comments

Comments
 (0)