Found during automated review of PR #405.
After the static-arity opcodes and call_self land, the compiled-closure call prologue (register-file build, vararg proto setup, 8-slot frame tuple, call_info, tick, depth check, dispatch/12 re-entry) is copy-pasted 9 times in lib/lua/vm/dispatcher.ex (~940-1290): 2 generic + 6 static-arity + call_self. Two copies already drift: @op_call_one_0 and @op_call_zero_0 inline %{callee_proto | varargs: []} instead of calling setup_vararg_proto/4 (currently equivalent).
Any call-protocol change now has 9 edit sites. Worth extracting a shared helper (or a defmacrop, though CLAUDE.md discourages macros unless warranted) once the perf stack (#400→#401→#403→#405) settles — measured to confirm the abstraction doesn't cost the win the duplication bought.
🤖 Filed from an automated review pass.
Found during automated review of PR #405.
After the static-arity opcodes and
call_selfland, the compiled-closure call prologue (register-file build, vararg proto setup, 8-slot frame tuple,call_info, tick, depth check,dispatch/12re-entry) is copy-pasted 9 times inlib/lua/vm/dispatcher.ex(~940-1290): 2 generic + 6 static-arity +call_self. Two copies already drift:@op_call_one_0and@op_call_zero_0inline%{callee_proto | varargs: []}instead of callingsetup_vararg_proto/4(currently equivalent).Any call-protocol change now has 9 edit sites. Worth extracting a shared helper (or a
defmacrop, though CLAUDE.md discourages macros unless warranted) once the perf stack (#400→#401→#403→#405) settles — measured to confirm the abstraction doesn't cost the win the duplication bought.🤖 Filed from an automated review pass.