ruby/yjit/bindgen
Randy Stauner beafae9750
YJIT: Specialize String#[] (String#slice) with fixnum arguments (#12069)
* YJIT: Specialize `String#[]` (`String#slice`) with fixnum arguments

String#[] is in the top few C calls of several YJIT benchmarks:
liquid-compile rubocop mail sudoku

This speeds up these benchmarks by 1-2%.

* YJIT: Try harder to get type info for `String#[]`

In the large generated code of the mail gem the context doesn't have
the type info.  In that case if we peek at the stack and add a guard
we can still apply the specialization
and it speeds up the mail benchmark by 5%.

Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
Co-authored-by: Takashi Kokubun (k0kubun) <takashikkbn@gmail.com>

---------

Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
Co-authored-by: Takashi Kokubun (k0kubun) <takashikkbn@gmail.com>
2024-11-13 12:25:09 -05:00
..
src YJIT: Specialize String#[] (String#slice) with fixnum arguments (#12069) 2024-11-13 12:25:09 -05:00
Cargo.lock YJIT: Allow shareable consts in multi-ractor mode (#11917) 2024-10-18 15:01:45 -04:00
Cargo.toml YJIT: Allow shareable consts in multi-ractor mode (#11917) 2024-10-18 15:01:45 -04:00