1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/tool
k0kubun fb80f6c7ba insns.def: optimize & and | of Integer [experimental]
not optimizing Array#& and Array#| because vm_insnhelper.c can't easily
inline it (large amount of array.c code would be needed in vm_insnhelper.c)
and the method body is a little complicated compared to Integer's ones.
So I thought only Integer#& and Integer#| have a significant impact,
and eliminating unnecessary branches would contribute to JIT's performance.

vm_insnhelper.c: ditto

tool/transform_mjit_header.rb: make sure these instructions are inlined
on JIT.

compile.c: compile vm_opt_and and vm_opt_or.
id.def: define id for them to be used in compile.c and vm*.c
vm.c: track redefinition of Integer#& and Integer#|
vm_core.h: allow detecting redefinition of & and |

test/ruby/test_jit.rb: test new insns
test/ruby/test_optimization.rb: ditto

* Optcarrot benchmark

This is a kind of experimental thing but I'm committing this since the
performance impact is significant especially on Optcarrot with JIT.

$ benchmark-driver benchmark.yml --rbenv 'before::before --disable-gems;before+JIT::before --disable-gems --jit;after::after --disable-gems;after+JIT::after --disable-gems --jit' -v --repeat-count 24
before: ruby 2.6.0dev (2018-09-24 trunk 64821) [x86_64-linux]
before+JIT: ruby 2.6.0dev (2018-09-24 trunk 64821) +JIT [x86_64-linux]
after: ruby 2.6.0dev (2018-09-24 opt_and 64821) [x86_64-linux]
last_commit=opt_or
after+JIT: ruby 2.6.0dev (2018-09-24 opt_and 64821) +JIT [x86_64-linux]
last_commit=opt_or
Calculating -------------------------------------
                             before  before+JIT       after   after+JIT
Optcarrot Lan_Master.nes     51.460      66.315      53.023      71.173 fps

Comparison:
             Optcarrot Lan_Master.nes
               after+JIT:        71.2 fps
              before+JIT:        66.3 fps - 1.07x  slower
                   after:        53.0 fps - 1.34x  slower
                  before:        51.5 fps - 1.38x  slower

[close https://github.com/ruby/ruby/pull/1963]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-24 12:40:28 +00:00
..
m4 use mingw ANSI stdio 2018-09-04 08:39:14 +00:00
ruby_vm _mjit_compile_send.erb: remove TODO comment solved [ci skip] 2018-09-24 06:21:19 +00:00
test
asm_parse.rb
bisect.sh
build-transcode
change_maker.rb
checksum.rb
colorize.rb
darwin-cc darwin-cc: hide ld warnings 2018-09-21 07:19:13 +00:00
downloader.rb tool/downloader.rb: retry 500 from GitHub 2018-08-18 02:04:44 +00:00
enc-emoji-citrus-gen.rb
enc-emoji4unicode.rb
enc-unicode.rb tool/enc-unicode.rb: rewrote without flip-flop 2018-09-22 20:39:35 +00:00
eval.rb
expand-config.rb
extlibs.rb
fake.rb
fetch-bundled_gems.rb
file2lastrev.rb
gem-unpack.rb
gen_dummy_probes.rb
gen_ruby_tapset.rb
generate-backport-changelog.rb
generic_erb.rb
git-refresh tool/git-refresh: skip git fetch and checkout 2018-07-08 05:52:12 +00:00
gperf.sed
id2token.rb
ifchange
insns2vm.rb
install-sh
jisx0208.rb
make-snapshot make-snapshot: fetch from the official git site 2018-07-28 12:47:36 +00:00
make_hgraph.rb
mdoc2man.rb
merger.rb
mk_call_iseq_optimized.rb _mjit_compile_send.erb: refactor code to setup iseq 2018-09-24 06:09:55 +00:00
mkconfig.rb
mkrunnable.rb
node_name.rb tool/node_name.rb: rewrote without flip-flop 2018-09-07 13:43:01 +00:00
parse.rb
prereq.status
probes_to_wiki.rb
rbinstall.rb Fixed installation failure with mswin environment. 2018-08-28 13:42:39 +00:00
rbuninstall.rb
redmine-backporter.rb get rid of an encode noncompatible error 2018-08-13 12:42:55 +00:00
release.sh
rmdirs
run-gcov.rb
run-lcov.rb
runruby.rb Add lldb as a debugger option 2018-07-09 17:49:21 +00:00
strip-rdoc.rb
sync_default_gems.rb Ignore native extension of Date library when syncing gemification files. 2018-08-06 05:01:08 +00:00
test-coverage.rb
transcode-tblgen.rb
transform_mjit_header.rb insns.def: optimize & and | of Integer [experimental] 2018-09-24 12:40:28 +00:00
update-deps common.mk: ruby tool/update-deps --fix 2018-09-17 01:31:06 +00:00
vcs.rb
vpath.rb
vtlh.rb
ytab.sed