diff options
| author | Jeremy Evans <code@jeremyevans.net> | 2024-01-25 10:00:09 -0800 |
|---|---|---|
| committer | Jeremy Evans <code@jeremyevans.net> | 2024-03-01 07:10:25 -0800 |
| commit | e484ffaf2016ae3261ce5810658f4634b434720e (patch) | |
| tree | 37c830eb7ca6a2df86cdb78d9c3710252099eb36 | |
| parent | 54d26221b4c4cfc46048f30892c626db69ce9244 (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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |
