ruby/defs
Randy Stauner 1dd40ec18a
Optimize instructions when creating an array just to call include? (#12123)
* Add opt_duparray_send insn to skip the allocation on `#include?`

If the method isn't going to modify the array we don't need to copy it.
This avoids the allocation / array copy for things like `[:a, :b].include?(x)`.

This adds a BOP for include? and tracks redefinition for it on Array.

Co-authored-by: Andrew Novoselac <andrew.novoselac@shopify.com>

* YJIT: Implement opt_duparray_send include_p

Co-authored-by: Andrew Novoselac <andrew.novoselac@shopify.com>

* Update opt_newarray_send to support simple forms of include?(arg)

Similar to opt_duparray_send but for non-static arrays.

* YJIT: Implement opt_newarray_send include_p

---------

Co-authored-by: Andrew Novoselac <andrew.novoselac@shopify.com>
2024-11-26 14:31:08 -05:00
..
gmake.mk Prevent test-bundled-gems outputs from mixing 2024-05-26 22:17:57 +09:00
id.def Optimize instructions when creating an array just to call include? (#12123) 2024-11-26 14:31:08 -05:00
keywords reserved_word: just use gperf 3.1 declaration 2022-09-21 11:44:09 +09:00
known_errors.def Add/revise Errno descriptions (#10897) 2024-06-04 15:19:50 +00:00
lex.c.src reserved_word: just use gperf 3.1 declaration 2022-09-21 11:44:09 +09:00
opt_insn_unif.def setdynamic is obsoleted 2016-04-27 07:11:06 +00:00
opt_operand.def * defs/opt_operand.def: Fix typo 2013-12-22 01:11:07 +00:00
separated_version.mk Fixed misspellings 2019-12-20 09:32:42 +09:00
tags.mk Add TAGS rule [ci skip] 2023-02-08 18:00:05 +09:00