summaryrefslogtreecommitdiff
path: root/test/ruby/test_jit.rb
AgeCommit message (Collapse)Author
2019-12-01Check MJIT support in one placeTakashi Kokubun
to fix test failure on trunk-no-mjit https://gist.github.com/ko1/32ab982ffd7555988818773c08f97123
2019-11-18pack is not using invokebuiltin anymoreTakashi Kokubun
2019-11-12Revert "Method reference operator"Nobuyoshi Nakada
This reverts commit 67c574736912003c377218153f9d3b9c0c96a17b. [Feature #16275]
2019-11-10Fix uplevel of test_jitTakashi Kokubun
2019-11-09Test opt_invokebuiltin_delegate_leave in test_jitTakashi Kokubun
2019-11-09Support RB_BUILTIN in ISeq#to_aTakashi Kokubun
2019-11-09Test invokebuiltin in test_jitTakashi Kokubun
ISeq#to_a is commented out because it's broken now
2019-11-09Extend sleep duration for SolarisTakashi Kokubun
2019-09-04Check frozen flag on MJIT setinstancevariableTakashi Kokubun
It does not seem to have a significant performance impact, hopefully? ``` $ benchmark-driver -v benchmark.yml --rbenv 'before --jit;after --jit' --repeat-count=24 --output=all before --jit: ruby 2.7.0dev (2019-09-03T21:02:24Z master 77596fb7a9) +JIT [x86_64-linux] after --jit: ruby 2.7.0dev (2019-09-04T01:54:44Z master 7363e22d79) +JIT [x86_64-linux] Calculating ------------------------------------- before --jit after --jit Optcarrot Lan_Master.nes 48.44054595799523 71.67010255902900 fps 71.32797692837639 71.97846863769546 72.51921961607691 78.87360980544105 73.54082925611047 79.80408132389941 74.03503843709451 79.85739528572826 74.04863857926493 79.89850834901381 75.30266276129467 80.34607233076015 75.69063990896244 80.88474397425360 75.70458132587405 81.09234267781642 77.39842764662852 82.13766823612643 77.76922944068329 82.20398304840373 81.17984044023393 82.26722630628272 82.85235776076533 82.71375902781254 83.04906099135320 82.75893420702198 83.10214168136230 82.79668965325972 83.71456007558125 82.85131667916379 84.06658306760725 82.95676565411722 84.25690684305728 83.19972846225775 84.27938663923503 83.28510503845854 84.45467716218090 83.41003730434703 84.51563186125925 83.67773614721280 84.56139892968321 84.02082201151110 84.69819452180658 84.10495346787033 84.78125989622576 84.47867803506055 ``` Note for backporter: test_jit's `success_count` would be 1 in Ruby 2.6, since 2.7 introduced "MJIT recompile" on JIT-ed code cancel. [Bug #16139]
2019-09-03Stop testing inexistent instructionsTakashi Kokubun
2019-09-03Add insn tests for newarraykwsplatTakashi Kokubun
2019-09-02Fix opt_regexpmatch1 referencesTakashi Kokubun
2019-08-29Revert "Remove warnings of flip-flop deprecation from tests and specs"Nobuyoshi Nakada
This reverts commit bf7a32d22079cc44eb19794e41d82b886d5d17b3. flip-flop is no longer deprecated. [Feature #5400]
2019-08-12Add another test for frame omitted inliningTakashi Kokubun
2019-08-02Revert "Remove opt_nil_p test to remove warning for now"Yusuke Endoh
This reverts commit a1727e43af18c122c4d7adfa603f895fdc8f3df1.
2019-08-02Remove opt_nil_p test to remove warning for nowTakashi Kokubun
2019-08-02Fix uplevelNobuyoshi Nakada
2019-08-01Add a test for opt_nil_pTakashi Kokubun
2019-07-14MJIT Support for getblockparamproxyTakashi Kokubun
2019-07-09Restore support library for only test files.Hiroshi SHIBATA
2019-07-03Just disable inlining with local varaible for nowTakashi Kokubun
This partially reverts commit 712a66b0741605f5b2db670a292b9bb352f8a716. The previous fix made CI strange like: http://ci.rvm.jp/results/trunk-vm-asserts@silicon-docker/2124178 Let me just downgrade the behavior for now and deal with it later. [Bug #15971]
2019-07-03Revert "Avoid corrupting VM stack on inlined setlocal"Koichi Sasada
This reverts commit ea30dd702512ff9df34fe8c71c825f8f901bf5b1. because it fails when VM_CHECK_MODE=1.
2019-07-02Avoid corrupting VM stack on inlined setlocalTakashi Kokubun
setlocal relies on cfp->ep, and frame-omitted method inlining introduced in Ruby 2.7 kept it wrong. This change might slow down frame-omitted method inlining for cfp->ep manipulation, and it obviously complicates the implementaion more. By introducing an optimization that changes Ruby's local variable to C local variable, we could optimize it and simplify the cfp->ep manipulation later. [Bug #15971]
2019-07-02Adjust jit_support file path.Hiroshi SHIBATA
2019-04-14Prefer uintptr_t over ptrdiff_t for i686k0kubun
as debugged in PR [close https://github.com/ruby/ruby/pull/2130] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-14Revert "Try to set false explicitly"k0kubun
This reverts commit a1b5d20068a9b1859b383b249e510cd33d196e4a. Revert "Revert "Skip recompiling tests on i686 Linux"" This reverts commit 7b88a9207b97b94bc3c3be35084c742296f4aff2. Revert "Simplify matrix for debugging" This reverts commit e85d6c5c5e62dde37c6f6ffdb7125b9008b9ebfa. Sorry, these 3 commits were under debugging in https://github.com/ruby/ruby/pull/2129 but accidentally merged by using `git svn dcommit` instead of `git push` to the topic branch :bow: git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-14Revert "Skip recompiling tests on i686 Linux"k0kubun
This reverts commit 19513c88d5f923abb7f226520192aef9f3fcc1c7. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-14Fix typo in platform matcherk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-14Skip recompiling tests on i686 Linuxk0kubun
somehow they are filing like https://travis-ci.org/ruby/ruby/jobs/519830085 but they are not so fatal. Let me just skip them for now and fix tests afterwards. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-14Recompile JIT-ed code without optimizationk0kubun
based on inline cache when JIT cancel happens by that. This feature was in the original MJIT implementation by Vladimir, but on merging MJIT to Ruby it was removed for simplification. This commit adds the functionality again for the following benchmark: https://github.com/benchmark-driver/misc/blob/52f05781f65467baf895bf6ba79d172c9b0826fd/concurrent-map/bench.rb (shown float is duration seconds. shorter is better) * Before ``` $ INHERIT=0 ruby -v bench.rb ruby 2.7.0dev (2019-04-13 trunk 67523) [x86_64-linux] -- 1.6507579649914987 $ INHERIT=0 ruby -v --jit bench.rb ruby 2.7.0dev (2019-04-13 trunk 67523) +JIT [x86_64-linux] -- 1.5091587850474752 $ INHERIT=1 ruby -v bench.rb ruby 2.7.0dev (2019-04-13 trunk 67523) [x86_64-linux] -- 1.6124781150138006 $ INHERIT=1 ruby --jit -v bench.rb ruby 2.7.0dev (2019-04-13 trunk 67523) +JIT [x86_64-linux] -- 1.7495657080435194 # <-- this ``` * After ``` $ INHERIT=0 ruby -v bench.rb ruby 2.7.0dev (2019-04-13 trunk 67523) [x86_64-linux] last_commit=Recompile JIT-ed code without optimization -- 1.653559010999743 $ INHERIT=0 ruby --jit -v bench.rb ruby 2.7.0dev (2019-04-13 trunk 67523) +JIT [x86_64-linux] last_commit=Recompile JIT-ed code without optimization -- 1.4738391840364784 $ INHERIT=1 ruby -v bench.rb ruby 2.7.0dev (2019-04-13 trunk 67523) [x86_64-linux] last_commit=Recompile JIT-ed code without optimization -- 1.645227018976584 $ INHERIT=1 ruby --jit -v bench.rb ruby 2.7.0dev (2019-04-13 trunk 67523) +JIT [x86_64-linux] last_commit=Recompile JIT-ed code without optimization -- 1.523708809982054 # <-- this ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-06Cover all insns in test_jit againk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-06Suppress unnecessary warnings in test_jitk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-06Resurrect a test dropped in r67442k0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-05add definemethod/definesmethod insn.ko1
* insns.def: add definemethod and definesmethod (singleton method) instructions. Old YARV contains these instructions, but it is moved to methods of FrozenCore class because remove number of instructions can improve performance for some techniques (static stack caching and so on). However, we don't employ these technique and it is hard to optimize/analysis definition sequence. So I decide to introduce them (and remove definition methods). `putiseq` insn is also removed. * vm_method.c (rb_scope_visibility_get): renamed to `vm_scope_visibility_get()` and make it accept `ec`. Same for `vm_scope_module_func_check()`. These fixes are result of refactoring `vm_define_method`. * vm_insnhelper.c (rb_vm_get_cref): renamed to `vm_get_cref` because of consistency with other functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-21Show retry's stdout as wellk0kubun
because stderr did not have sufficient information https://ci.appveyor.com/project/ruby/ruby/builds/23242505/job/dirugxujk70nnhp6 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-21Explain why cl.exe needs --jit-verbose=2 [ci skip]k0kubun
I forgot to explain it in the previous commit git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-21Insert --jit-verbose=2 logs for mswin debuggingk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-10test_jit.rb: change format of test error outputk0kubun
to avoid breaking redmine quote like https://bugs.ruby-lang.org/issues/15522 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-01test_jit.rb: test methodref insnk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-29test_jit.rb: suppress random test failurek0kubun
on mswin RubyCI by Permission Denied. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-29test_jit.rb: prevent mixing outputs by race conditionk0kubun
to avoid random failures like https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11s/ruby-trunk/log/20181229T032506Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-28test_jit.rb: suppress random failure on RubyCIk0kubun
This failure is a known issue that exists mainly on CI environments. We should address this at some moment, but making CI red by this would be just a false-positive alarm for now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-21test_jit.rb: show debug info for success_count testk0kubun
to investigate https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11s/ruby-trunk/log/20181221T092505Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06Speed up hash literals by dupingtenderlove
This commit replaces the `newhashfromarray` instruction with a `duphash` instruction. Instead of allocating a new hash from an array stored in the Instruction Sequences, store a hash directly in the instruction sequences and dup it on execution. == Instruction sequence changes == ```ruby code = <<-eorby { "foo" => "bar", "baz" => "lol" } eorby insns = RubyVM::InstructionSequence.compile(code, __FILE__, nil, 0, frozen_string_literal: true) puts insns.disasm ``` On Ruby 2.5: ``` == disasm: #<ISeq:<compiled>@test.rb:0 (0,0)-(0,36)>==================== 0000 putobject "foo" 0002 putobject "bar" 0004 putobject "baz" 0006 putobject "lol" 0008 newhash 4 0010 leave ``` Ruby 2.6@r66174 3b6321083a2e3525da3b34d08a0b68bac094bd7f: ``` $ ./ruby test.rb == disasm: #<ISeq:<compiled>@test.rb:0 (0,0)-(0,36)> (catch: FALSE) 0000 newhashfromarray 2, ["foo", "bar", "baz", "lol"] 0003 leave ``` Ruby 2.6 + This commit: ``` $ ./ruby test.rb == disasm: #<ISeq:<compiled>@test.rb:0 (0,0)-(0,36)> (catch: FALSE) 0000 duphash {"foo"=>"bar", "baz"=>"lol"} 0002 leave ``` == Benchmark Results == Compared to 2.5.3: ``` $ make benchmark ITEM=hash_literal_small COMPARE_RUBY=/Users/aaron/.rbenv/versions/2.5.3/bin/ruby generating known_errors.inc known_errors.inc unchanged ./revision.h unchanged /Users/aaron/.rbenv/shims/ruby --disable=gems -rrubygems -I./benchmark/lib ./benchmark/benchmark-driver/exe/benchmark-driver \ --executables="compare-ruby::/Users/aaron/.rbenv/versions/2.5.3/bin/ruby -I.ext/common --disable-gem" \ --executables="built-ruby::./miniruby -I./lib -I. -I.ext/common -r./prelude --disable-gem" \ $(find ./benchmark -maxdepth 1 -name '*hash_literal_small*.yml' -o -name '*hash_literal_small*.rb' | sort) Calculating ------------------------------------- compare-ruby built-ruby hash_literal_small2 1.498 1.877 i/s - 1.000 times in 0.667581s 0.532656s hash_literal_small4 1.197 1.642 i/s - 1.000 times in 0.835375s 0.609160s hash_literal_small8 0.620 1.215 i/s - 1.000 times in 1.611638s 0.823090s Comparison: hash_literal_small2 built-ruby: 1.9 i/s compare-ruby: 1.5 i/s - 1.25x slower hash_literal_small4 built-ruby: 1.6 i/s compare-ruby: 1.2 i/s - 1.37x slower hash_literal_small8 built-ruby: 1.2 i/s compare-ruby: 0.6 i/s - 1.96x slower ``` Compared to r66255 ``` $ make benchmark ITEM=hash_literal_small COMPARE_RUBY=/Users/aaron/.rbenv/versions/ruby-trunk/bin/ruby generating known_errors.inc known_errors.inc unchanged ./revision.h unchanged /Users/aaron/.rbenv/shims/ruby --disable=gems -rrubygems -I./benchmark/lib ./benchmark/benchmark-driver/exe/benchmark-driver \ --executables="compare-ruby::/Users/aaron/.rbenv/versions/ruby-trunk/bin/ruby -I.ext/common --disable-gem" \ --executables="built-ruby::./miniruby -I./lib -I. -I.ext/common -r./prelude --disable-gem" \ $(find ./benchmark -maxdepth 1 -name '*hash_literal_small*.yml' -o -name '*hash_literal_small*.rb' | sort) Calculating ------------------------------------- compare-ruby built-ruby hash_literal_small2 1.567 1.831 i/s - 1.000 times in 0.638056s 0.546039s hash_literal_small4 1.298 1.652 i/s - 1.000 times in 0.770214s 0.605182s hash_literal_small8 0.873 1.216 i/s - 1.000 times in 1.145304s 0.822047s Comparison: hash_literal_small2 built-ruby: 1.8 i/s compare-ruby: 1.6 i/s - 1.17x slower hash_literal_small4 built-ruby: 1.7 i/s compare-ruby: 1.3 i/s - 1.27x slower hash_literal_small8 built-ruby: 1.2 i/s compare-ruby: 0.9 i/s - 1.39x slower ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-26test_jit.rb: skip a test for Windows for nowk0kubun
https://ci.appveyor.com/project/ruby/ruby/builds/20558412 removing CloseHandle disallows us to remove the DLL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-26process.c: finish MJIT prior to #execk0kubun
to prevent ruby from leaving MJIT-related files. test_jit.rb: add a test to prevent that git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-18test_jit.rb: loosen output checkk0kubun
for interleaving between processes https://gist.github.com/ko1/ace0374825377b41628d4590b7377601 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-18test_jit.rb: dump information to debug test failurek0kubun
debugging http://ci.rvm.jp/results/trunk-vm-asserts@silicon-docker/1466123 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-18mjit_worker.c: support MJIT in forked Ruby processk0kubun
by launching MJIT worker thread in child Ruby process. See the comment before `mjit_child_after_fork` for details. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-18test_jit.rb: fix typo [ci skip]k0kubun
we don't have such VM register git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e