mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Add peephole optimizer for newarray(X)/expandarray(X, 0) -> opt_reverse(X)
This renames the reverse instruction to opt_reverse, since now it is only added by the optimizer. Then it uses as a more general form of swap. This optimizes multiple assignment in the popped case with more than two elements.
This commit is contained in:
parent
d9167491db
commit
5089b6acc7
Notes:
git
2022-08-10 14:20:08 +09:00
2 changed files with 11 additions and 2 deletions
|
@ -599,7 +599,7 @@ swap
|
|||
|
||||
/* reverse stack top N order. */
|
||||
DEFINE_INSN
|
||||
reverse
|
||||
opt_reverse
|
||||
(rb_num_t n)
|
||||
(...)
|
||||
(...)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue