Perform splatarray false peephole optimization for invokesuper in addition to send

This optimizes cases such as:

  super(arg, *ary)
  super(arg, *ary, &block)
  super(*ary, **kw)
  super(*ary, kw: 1)
  super(*ary, kw: 1, &block)

The super(*ary, **kw, &block) case does not use the splatarray false
optimization.  This is also true of the send case, since the
introduction of the splatkw VM instruction.  That will be fixed in
a later commit.
This commit is contained in:
Jeremy Evans 2024-01-25 10:00:09 -08:00
Родитель 54d26221b4
Коммит e484ffaf20
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -3192,7 +3192,7 @@ optimize_args_splat_no_copy(rb_iseq_t *iseq, INSN *insn, LINK_ELEMENT *niobj,
unsigned int set_flags, unsigned int unset_flags)
{
LINK_ELEMENT *iobj = (LINK_ELEMENT *)insn;
if (!IS_NEXT_INSN_ID(niobj, send)) {
if (!IS_NEXT_INSN_ID(niobj, send) && !IS_NEXT_INSN_ID(niobj, invokesuper)) {
return false;
}
niobj = niobj->next;