summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Evans <[email protected]>2024-01-25 10:00:09 -0800
committerJeremy Evans <[email protected]>2024-03-01 07:10:25 -0800
commite484ffaf2016ae3261ce5810658f4634b434720e (patch)
tree37c830eb7ca6a2df86cdb78d9c3710252099eb36
parent54d26221b4c4cfc46048f30892c626db69ce9244 (diff)
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.
-rw-r--r--compile.c2
1 files changed, 1 insertions, 1 deletions
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;