From e484ffaf2016ae3261ce5810658f4634b434720e Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Thu, 25 Jan 2024 10:00:09 -0800 Subject: [PATCH] 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. --- compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compile.c b/compile.c index e68f06ef1f..b330511b12 100644 --- a/compile.c +++ b/compile.c @@ -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;