ruby/test
Jeremy Evans f6254f77f7 Speed up calling iseq bmethods
Currently, bmethod arguments are copied from the VM stack to the
C stack in vm_call_bmethod, then copied from the C stack to the VM
stack later in invoke_iseq_block_from_c.  This is inefficient.

This adds vm_call_iseq_bmethod and vm_call_noniseq_bmethod.
vm_call_iseq_bmethod is an optimized method that skips stack
copies (though there is one copy to remove the receiver from
the stack), and avoids calling vm_call_bmethod_body,
rb_vm_invoke_bmethod, invoke_block_from_c_proc,
invoke_iseq_block_from_c, and vm_yield_setup_args.

Th vm_call_iseq_bmethod argument handling is similar to the
way normal iseq methods are called, and allows for similar
performance optimizations when using splats or keywords.
However, even in the no argument case it's still significantly
faster.

A benchmark is added for bmethod calling.  In my environment,
it improves bmethod calling performance by 38-59% for simple
bmethod calls, and up to 180% for bmethod calls passing
literal keywords on both sides.

```

./miniruby-iseq-bmethod:  18159792.6 i/s
          ./miniruby-m:  13174419.1 i/s - 1.38x  slower

                   bmethod_simple_1
./miniruby-iseq-bmethod:  15890745.4 i/s
          ./miniruby-m:  10008972.7 i/s - 1.59x  slower

             bmethod_simple_0_splat
./miniruby-iseq-bmethod:  13142804.3 i/s
          ./miniruby-m:  11168595.2 i/s - 1.18x  slower

             bmethod_simple_1_splat
./miniruby-iseq-bmethod:  12375791.0 i/s
          ./miniruby-m:   8491140.1 i/s - 1.46x  slower

                   bmethod_no_splat
./miniruby-iseq-bmethod:  10151258.8 i/s
          ./miniruby-m:   8716664.1 i/s - 1.16x  slower

                    bmethod_0_splat
./miniruby-iseq-bmethod:   8138802.5 i/s
          ./miniruby-m:   7515600.2 i/s - 1.08x  slower

                    bmethod_1_splat
./miniruby-iseq-bmethod:   8028372.7 i/s
          ./miniruby-m:   5947658.6 i/s - 1.35x  slower

                   bmethod_10_splat
./miniruby-iseq-bmethod:   6953514.1 i/s
          ./miniruby-m:   4840132.9 i/s - 1.44x  slower

                  bmethod_100_splat
./miniruby-iseq-bmethod:   5287288.4 i/s
          ./miniruby-m:   2243218.4 i/s - 2.36x  slower

                         bmethod_kw
./miniruby-iseq-bmethod:   8931358.2 i/s
          ./miniruby-m:   3185818.6 i/s - 2.80x  slower

                      bmethod_no_kw
./miniruby-iseq-bmethod:  12281287.4 i/s
          ./miniruby-m:  10041727.9 i/s - 1.22x  slower

                   bmethod_kw_splat
./miniruby-iseq-bmethod:   5618956.8 i/s
          ./miniruby-m:   3657549.5 i/s - 1.54x  slower
```
2023-04-25 08:06:16 -07:00
..
-ext- [Feature #19579] Remove !USE_RVARGC code (#7655) 2023-04-04 17:30:06 -04:00
base64
benchmark
bigdecimal [ruby/bigdecimal] Handle correctly #remainder with infinity. Fixes 2023-02-17 17:46:27 +00:00
cgi [ruby/cgi] Loosen the domain regex to accept '.' 2022-11-28 04:34:11 +00:00
coverage More coverage tests & specs. (#7171) 2023-01-22 13:49:13 +13:00
csv s/MJIT/RJIT/ 2023-03-06 23:44:01 -08:00
date [ruby/date] Implement Date#deconstruct_keys and DateTime#deconstruct_keys 2022-12-13 19:52:06 +00:00
did_you_mean [ruby/did_you_mean] Support the new message format of NameError in 2023-02-19 07:10:47 +00:00
digest [ruby/digest] Ignore test_ractor.rb on non-Ractor ruby 2022-07-21 11:45:48 +09:00
drb s/MJIT/RJIT/ 2023-03-06 23:44:01 -08:00
dtrace Use omit instead of skip without the default gems tests 2022-01-11 21:17:59 +09:00
erb [ruby/erb] Fix line numbers after multi-line <%# 2022-11-29 04:56:03 +00:00
error_highlight [ruby/error_highlight] Support the new message format of NameError in Ruby 3.3 2023-02-19 10:29:56 +00:00
etc
excludes A file was missing in test/excludes for TestArraySubclass 2023-02-28 11:04:32 +09:00
fiber Support `IO#pread` / `IO#pwrite` using fiber scheduler. (#7594) 2023-03-31 00:48:55 +13:00
fiddle Merge fiddle-1.1.1 2022-12-09 16:36:22 +09:00
fileutils [ruby/fileutils] Add mkdir_p to FileUtils.install 2023-02-10 03:37:39 +00:00
fixtures/fake_sorted_set_gem
io Remove `require 'io/wait'` where it's no longer necessary. (#6932) 2022-12-15 11:37:01 +13:00
irb Temporary skipped failing assertions 2023-04-25 15:05:14 +09:00
json [flori/json] test parsing of unicode, mixing literal characters with escaped 2022-07-29 19:10:10 +09:00
lib Revert an accidentally sync. 2023-03-27 12:28:11 +09:00
logger [ruby/logger] Add Logger#with_level{...} for block-scoped log level. 2023-02-10 01:08:49 +00:00
mkmf mkconfig: Map `includedir` only for system ruby 2023-01-31 06:33:16 +09:00
monitor
net s/mjit/rjit/ 2023-03-06 23:44:01 -08:00
nkf
objspace Fix interpreter crash caused by RUBY_INTERNAL_EVENT_NEWOBJ + Ractors 2023-03-09 09:46:14 +01:00
open-uri Add :ssl_min_version and :ssl_max_version options 2022-10-12 10:36:51 +09:00
openssl [ruby/openssl] Relax error message check for OpenSSL 3.1 2023-03-16 17:17:46 +09:00
optparse [ruby/optparse] Add symbolize_names to getopts 2022-12-26 15:09:21 +09:00
ostruct [ruby/ostruct] Fix class and method as attribute names 2022-03-07 20:08:22 +09:00
pathname [ruby/pathname] Implement Pathname#lutime 2022-04-21 17:10:19 +09:00
psych [ruby/psych] Update for stricter 1.2 syntax 2023-01-31 13:14:05 +09:00
racc [ruby/racc] Get rid of anonymous eval calls 2023-01-12 07:52:29 +09:00
rdoc [ruby/rdoc] Read generated files in binary mode 2023-03-31 01:14:34 +00:00
readline [ruby/readline-ext] test_readline.rb only needs EnvUtil 2023-02-22 01:18:26 +00:00
reline [ruby/reline] Change Reline.add_dialog_proc(name, nil) to properly 2023-04-15 09:32:05 +00:00
resolv [ruby/resolv] Do not compress domain name in SRV RDATA 2023-04-08 14:16:59 +00:00
rinda s/MJIT/RJIT/ 2023-03-06 23:44:01 -08:00
ripper [Bug #19563] Yield words separators per lines 2023-04-07 23:13:56 +09:00
ruby Speed up calling iseq bmethods 2023-04-25 08:06:16 -07:00
rubygems [rubygems/rubygems] Bump rb-sys 2023-04-24 22:19:25 +00:00
socket Skip test_udp_server on s390x RHEL 7.1 2023-03-11 20:51:49 -08:00
stringio [ruby/stringio] [Bug #19389] Fix chomping with longer separator 2023-01-28 13:00:08 +00:00
strscan [ruby/strscan] Mask out this test on JRuby/Windows 2023-02-21 19:31:39 +09:00
syslog
uri [ruby/uri] Increase rehearsals 2023-03-29 09:52:33 +09:00
win32ole [ruby/win32ole] Skip test failure with mswin platform 2023-03-29 04:00:22 +00:00
yaml Relax the timeout of a YAML test 2022-12-01 15:37:41 -08:00
zlib [ruby/zlib] Fix the test broken in older versions 2023-01-09 09:58:43 +00:00
runner.rb Use the built bundled gems in test-all as well as test-bundled-gems 2022-12-09 02:20:16 +09:00
test_abbrev.rb
test_delegate.rb [ruby/delegate] Revert "Fix `DelegateClass` block "method redefined" warning" 2022-12-01 08:08:02 +00:00
test_extlibs.rb dbm and gdbm have been extracted gems. 2022-09-28 17:06:12 +09:00
test_find.rb [ruby/find] Use omit instead of skip for test-unit 2022-01-11 21:40:51 +09:00
test_forwardable.rb
test_getoptlong.rb
test_ipaddr.rb [ruby/ipaddr] Fix exception calling `to_range' after `freeze' 2022-02-10 17:18:05 +09:00
test_mutex_m.rb [ruby/mutex_m] Avoid anonymous eval 2023-01-12 05:41:59 +00:00
test_observer.rb
test_open3.rb Removed to load jit_support.rb 2023-03-14 12:51:58 +09:00
test_pp.rb [ruby/pp] [Feature #19045] Add support Data#pretty_print 2022-10-14 21:31:24 +09:00
test_prettyprint.rb
test_pstore.rb [ruby/pstore] Emphasize keys instead of roots, values instead of objects (https://github.com/ruby/pstore/pull/7) 2022-07-07 07:05:01 +09:00
test_pty.rb Use omit instead of skip without the default gems tests 2022-01-11 21:17:59 +09:00
test_rbconfig.rb mkconfig: Map `includedir` only for system ruby 2023-01-31 06:33:16 +09:00
test_securerandom.rb [ruby/securerandom] Split Random::Formatter from SecureRandom [Feature #18190] 2021-12-09 20:26:44 +09:00
test_set.rb [ruby/set] Set#merge does not take keyword arguments as a Hash 2023-02-24 11:48:08 +00:00
test_shellwords.rb
test_singleton.rb
test_sorted_set.rb
test_syslog.rb
test_tempfile.rb
test_time.rb [ruby/time] Test for quadratic backtracking on invalid time 2023-03-30 10:44:37 +00:00
test_timeout.rb [ruby/timeout] Simplify test 2023-02-15 19:25:05 +00:00
test_tmpdir.rb [ruby/tmpdir] Warnings should contain the environment variable name 2022-10-27 03:12:00 +00:00
test_trick.rb Add all-ruby-quine as a sample code 2023-02-27 11:20:42 +09:00
test_tsort.rb
test_unicode_normalize.rb Prefer to use File.readlines instead of IO.readlines 2023-02-27 18:49:18 +09:00
test_weakref.rb