summaryrefslogtreecommitdiff
path: root/tool/ruby_vm
AgeCommit message (Collapse)Author
2019-04-23[ci skip] grammers in commentsUrabe, Shyouhei
2019-04-20Invalidate JIT-ed code if ISeq is moved by GC.compactk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-16Recompile without method inliningk0kubun
if cancel happens in an inlined method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-16Introduce frame-omitted method inliningk0kubun
for ISeq including only leaf and no-handles_sp insns except leaf. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-16Implement single-level basic method inlining in JITk0kubun
"Basic" means it does not omit a call frame. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-14Do not require Ruby 2.4 for baserubyk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-14Share optimization cancel handlersk0kubun
$ benchmark-driver benchmark.yml --rbenv='before --jit;after --jit' -v --output=all --repeat-count=12 before --jit: ruby 2.7.0dev (2019-04-14 trunk 67549) +JIT [x86_64-linux] after --jit: ruby 2.7.0dev (2019-04-14 trunk 67549) +JIT [x86_64-linux] last_commit=Share optimization cancel handlers Calculating ------------------------------------- before --jit after --jit Optcarrot Lan_Master.nes 69.55360655447375 74.15329176797863 fps 73.74545038318978 79.60903046141544 75.85637357897092 82.00930075612054 77.10594124022951 82.56228187301674 78.67350527368366 83.37512204205953 79.97235230767613 83.41521927993719 81.03050342478066 84.20227901852776 81.61308297895094 84.73733526226468 82.06805141753206 85.27884867863791 82.46493179193394 85.36558922650367 83.85259832896313 85.39993587223481 84.02325292922997 85.63649355214602 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-14Detect send-compatible opt insns automaticallyk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-14Allow falling back to non-inlined opt_send_without_blockk0kubun
for opt_aref with inline cache to minimize the possibility of JIT cancel. Also opt_aset and opt_mod are added for the targets. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-14Unify comment styles across MJIT sourcesk0kubun
I'm writing `//` comments in newer MJIT code after C99 enablement (because I write 1-line comments more often than multi-line comments and `//` requires fewer chars on 1-line) and then they are mixed with `/* */` now. For consistency and to avoid the conversion in future changes, let me finish the rewrite in MJIT-related code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67533 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-06Fix typo in a comment [ci skip]k0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-29Add debug counters for MJIT cancelk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-25Prefer using vm_base_ptr rather than cfp->bpk0kubun
in MJIT implementation. This allows us to drop cfp->bp by just modifying vm_base_ptr in the future. No performance impact: $ benchmark-driver benchmark.yml --rbenv='before::before --disable-gems --jit;bp_::after --disable-gems --jit;vm_env_ptr::ruby-svn --disable-gems --jit' -v --output=all --repeat-count=12 before: ruby 2.7.0dev (2019-03-24 trunk 67341) +JIT [x86_64-linux] bp_: ruby 2.7.0dev (2019-03-24 trunk 67342) +JIT [x86_64-linux] vm_env_ptr: ruby 2.7.0dev (2019-03-25 trunk 67343) +JIT [x86_64-linux] last_commit=Prefer using vm_base_ptr rather than cfp->bp Calculating ------------------------------------- before bp_ vm_env_ptr Optcarrot Lan_Master.nes 77.15059205092646 70.18873044267853 69.62171387083328 fps 78.75767783870441 77.49867689173411 75.43496867709587 79.60102690369321 77.78037687683523 79.36688927929428 80.25144236638835 78.74729849101701 80.42363742291455 82.22375417165489 80.44265482494045 80.90287243299306 82.29166786292619 80.51740049420938 81.81153053252902 83.35386925305345 80.91054205210609 81.93562989125176 83.39770634366975 81.34550754145043 82.24544621470430 83.88523450309972 81.60698516017347 82.76801860263230 84.17553130135879 82.69615943446324 83.02530407910871 84.42132328119858 83.00969158037691 83.19968539409922 84.60731429793329 83.32703363300098 83.81352746019631 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-25use cfp->bp more.ko1
cfp->bp was (re-)introduced by Kokubun san, but VM doesn't use it because I (ko1) want to remove it in a future. But using it make leave instruction fast because of sp consisntency check. So now VM uses cfp->bp. To use cfp->bp, I checked the value and I found that it is not a "initial value of sp" but a "initial value of ep". Fix this problem and fix all bp references (this is why bp is renamed to bp_). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-21Check argument_arity_error condition in inlinable_iseq_pk0kubun
to avoid inlining a method call when it becomes argument_arity_error, fixing a potential bug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-01_leaf_helpers.erb: some functions are not leafshyouhei
If a function has rb_warning() that is not a leaf because warning ultimately is a method call of Warning#warn. If a function has rb_name_error() that is not a leaf because NameError is allocated, then initialized. This of course involves calling NameError#initialize. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-31_insn_type_chars.erb: use C99shyouhei
Now that comma at the end of enum is allowed, we can write this much more straight-forward. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-31_insn_operand_info.erb: use C99shyouhei
Same as r66957. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-31_insn_len_info.erb: add ASSERT_VM_INSTRUCTION_SIZEshyouhei
Also previous rb_vm_insn_len_info is now a function static variable. It seems nobody else is using it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-31_insn_name_info.erb: use C99shyouhei
C99 allows string literals of at least 4095 characters (cf: ISO/IEC 9899:1999 section 5.2.4.1) so the previous complex struct layout is no longer necessary. Just dump the verbatim memory contents we want. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-25vm.inc now in C99shyouhei
This changeset modifies the VM generator so that vm.inc is written in C99. Also added some comments in _insn_entry.erb so that the intention of each parts to be made more clear. I think this improves overall readability of the generated VM. Confirmed that the exact same binary is generated before/after this changeset. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-10mjit.c: use boolean type for boolean variablesk0kubun
and functions to clarify the intention and make sure it's not used in a surprising way (like using 2, 3, ... other than 0, 1 even while it seems to be a boolean). This is a retry of r66775. It included some typos... git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-27Arrange as same as comment and return statementkazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-27delete emacs mode lines [ci skip]shyouhei
These settings are now covered by .dir-locals.el. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-26Fix typos [ci skip]kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-26add #line [ci skip]shyouhei
These erb files are in fact erb comments + plain C. Adding #line help us debug in case we have trouble there. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-26insns.def: refactor to avoid CALL_METHOD macroshyouhei
These send and its variant instructions are the most frequently called paths in the entire process. Reducing macro expansions to make them dedicated function called vm_sendish() is the main goal of this changeset. It reduces the size of vm_exec_coref from 25,552 bytes to 23,728 bytes on my machine. I see no significant slowdown. Fix: [GH-2056] vanilla: ruby 2.6.0dev (2018-12-19 trunk 66449) [x86_64-darwin15] ours: ruby 2.6.0dev (2018-12-19 refactor-send 66449) [x86_64-darwin15] last_commit=insns.def: refactor to avoid CALL_METHOD macro Calculating ------------------------------------- vanilla ours vm2_defined_method 2.645M 2.823M i/s - 6.000M times in 5.109888s 4.783254s vm2_method 8.553M 8.873M i/s - 6.000M times in 1.579892s 1.524026s vm2_method_missing 3.772M 3.858M i/s - 6.000M times in 3.579482s 3.499220s vm2_method_with_block 8.494M 8.944M i/s - 6.000M times in 1.589774s 1.509463s vm2_poly_method 0.571 0.607 i/s - 1.000 times in 3.947570s 3.733528s vm2_poly_method_ov 5.514 5.168 i/s - 1.000 times in 0.408156s 0.436169s vm3_clearmethodcache 2.875 2.837 i/s - 1.000 times in 0.783018s 0.793493s Comparison: vm2_defined_method ours: 2822555.4 i/s vanilla: 2644878.1 i/s - 1.07x slower vm2_method ours: 8872947.8 i/s vanilla: 8553433.1 i/s - 1.04x slower vm2_method_missing ours: 3858192.3 i/s vanilla: 3772296.3 i/s - 1.02x slower vm2_method_with_block ours: 8943825.1 i/s vanilla: 8493955.0 i/s - 1.05x slower vm2_poly_method ours: 0.6 i/s vanilla: 0.6 i/s - 1.06x slower vm2_poly_method_ov vanilla: 5.5 i/s ours: 5.2 i/s - 1.07x slower vm3_clearmethodcache vanilla: 2.9 i/s ours: 2.8 i/s - 1.01x slower git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-26add _sp_inc_helpers.erb [ci skip]shyouhei
Just add more room for comments. This is a pure refactoring that does not change anything but readability. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-26Support targetting TracePoint [Feature #15289]ko1
* vm_trace.c (rb_tracepoint_enable_for_target): support targetting TracePoint. [Feature #15289] Tragetting TracePoint is only enabled on specified method, proc and so on, example: `tp.enable(target: code)`. `code` should be consisted of InstructionSeuqnece (iseq) (RubyVM::InstructionSeuqnece.of(code) should not return nil) If code is a tree of iseq, TracePoint is enabled on all of iseqs in a tree. Enabled tragetting TracePoints can not enabled again with and without target. * vm_core.h (rb_iseq_t): introduce `rb_iseq_t::local_hooks` to store local hooks. `rb_iseq_t::aux::trace_events` is renamed to `global_trace_events` to contrast with `local_hooks`. * vm_core.h (rb_hook_list_t): add `rb_hook_list_t::running` to represent how many Threads/Fibers are used this list. If this field is 0, nobody using this hooks and we can delete it. This is why we can remove code from cont.c. * vm_core.h (rb_vm_t): because of above change, we can eliminate `rb_vm_t::trace_running` field. Also renamed from `rb_vm_t::event_hooks` to `global_hooks`. * vm_core.h, vm.c (ruby_vm_event_enabled_global_flags): renamed from `ruby_vm_event_enabled_flags. * vm_core.h, vm.c (ruby_vm_event_local_num): added to count enabled targetting TracePoints. * vm_core.h, vm_trace.c (rb_exec_event_hooks): accepts hook list. * vm_core.h (rb_vm_global_hooks): added for convinience. * method.h (rb_method_bmethod_t): added to maintain Proc and `rb_hook_list_t` for bmethod (defined by define_method). * prelude.rb (TracePoint#enable): extracet a keyword parameter (because it is easy than writing in C). It calls `TracePoint#__enable` internal method written in C. * vm_insnhelper.c (vm_trace): check also iseq->local_hooks. * vm.c (invoke_bmethod): check def->body.bmethod.hooks. * vm.c (hook_before_rewind): check iseq->local_hooks and def->body.bmethod.hooks before rewind by exception. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-11Use friendlier terminology in leaf helpersnobu
[Fix GH-2009] From: Juanito Fatas <juanito.fatas@shopify.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-30_mjit_compile_send.erb: do not inline tailcall ISeqk0kubun
because it's not supported by this file. Also, shared `def_iseq_ptr` instead of copying the main definition of it. vm_core.h: moved `def_iseq_ptr` to this place. added `inline` to avoid compiler warnings since it's not used in some files including vm_core.h. vm_insnhelper.c: moved `def_iseq_ptr` to vm_core.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-29less verbose code by sharing attribute definitionsshyouhei
The idea behind this commit is that handles_sp and leaf are two concepts that are not mutually independent. By making one explicitly depend another, we can reduces the number of lines of codes written, thus making things concise. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-29bare_instructions.rb: sort attributes [ci skip]shyouhei
This enhances stability of the generated source code (namely insns_info.inc) across attribute insertion / deletion. It does not change the compiled binary at all; just a bit of readability. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-24_mjit_compile_ivar.erb: cancel on undefined ivark0kubun
I assumed somehow this check was not needed, but it did need. By canceling this instead of just warning here, we didn't lose the current performance so much. test_jit.rb: test the case that reproduces SEGV by that. TestGemStreamUI.rb: delete. This test on --jit-wait is fixed. === Optcarrot Benchmark === $ benchmark-driver benchmark.yml --rbenv 'before::before --disable-gems --jit;after::after --disable-gems --jit' -v --repeat-count 24 before: ruby 2.6.0dev (2018-10-24 trunk 65355) +JIT [x86_64-linux] after: ruby 2.6.0dev (2018-10-24 trunk 65355) +JIT [x86_64-linux] last_commit=_mjit_compile_ivar.erb: cancel on undefined ivar Calculating ------------------------------------- before after Optcarrot Lan_Master.nes 85.344 84.849 fps Comparison: Optcarrot Lan_Master.nes before: 85.3 fps after: 84.8 fps - 1.01x slower git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-23_mjit_compile_send.erb: fix wrong cc usagesk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-21mjit.c: remove wrongly-committed debug codek0kubun
mistake in r65279. === Optcarrot Benchmark === $ benchmark-driver benchmark.yml --rbenv 'before::before --disable-gems --jit;after::after --disable-gems --jit' -v --repeat-count 24 before: ruby 2.6.0dev (2018-10-21 trunk 65277) +JIT [x86_64-linux] after: ruby 2.6.0dev (2018-10-21 trunk 65279) +JIT [x86_64-linux] last_commit=mjit.c: remove wrongly-committed debug code Calculating ------------------------------------- before after Optcarrot Lan_Master.nes 85.008 86.078 fps Comparison: Optcarrot Lan_Master.nes after: 86.1 fps before: 85.0 fps - 1.01x slower git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-21mjit.c: copy call cache values to MJIT workerk0kubun
same as r65275 but for call cache. === Optcarrot Benchmark === $ benchmark-driver benchmark.yml --rbenv 'before::before --disable-gems --jit;after::after --disable-gems --jit' -v --repeat-count 24 before: ruby 2.6.0dev (2018-10-21 trunk 65277) +JIT [x86_64-linux] after: ruby 2.6.0dev (2018-10-21 trunk 65277) +JIT [x86_64-linux] last_commit=mjit.c: copy call cache values to MJIT worker Calculating ------------------------------------- before after Optcarrot Lan_Master.nes 85.372 85.359 fps Comparison: Optcarrot Lan_Master.nes before: 85.4 fps after: 85.4 fps - 1.00x slower git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-21_mjit_compile_send.erb: don't split send_guardk0kubun
to another file, because it's no longer shared. It was created when attr_reader was inlined but it's no longer included. common.mk: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-21mjit.c: copy inline cache values to MJIT workerk0kubun
on VM_CHECK_INTS. Letting MJIT worker directly see inline cache which may be being updated could result in inconsistent IC index and serial. mjit_worker.c: request the copy job after dequeue, and receive the result synchronously. tool/ruby_vm/views/_mjit_compile_ivar.erb: use the copied IC mjit_compile.c: change the interface to pass is_entries mjit.h: ditto === Optcarrot Benchmark === Thankfully this didn't have major performance regression. $ benchmark-driver benchmark.yml --rbenv 'before::before --disable-gems --jit;after::after --disable-gems --jit' -v --repeat-count 24 before: ruby 2.6.0dev (2018-10-21 trunk 65263) +JIT [x86_64-linux] after: ruby 2.6.0dev (2018-10-21 trunk 65263) +JIT [x86_64-linux] last_commit=mjit.c: copy inline cache values to MJIT worker Calculating ------------------------------------- before after Optcarrot Lan_Master.nes 85.421 85.454 fps Comparison: Optcarrot Lan_Master.nes after: 85.5 fps before: 85.4 fps - 1.00x slower git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20revert r65213 and r65215k0kubun
as we didn't agree on the actual implementation yet git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20vm_insnhelper.c: never cache getinstancevariable twicek0kubun
We have several options to ensure there's no race condition between main thread and MJIT thead about IC reference: 1) Give up caching ivar for multiple classes (or multiple versions of the same class) in the same getinstancevariable (This commit's approach) 2) Allocate new inline cache every time Other ideas we could think of couldn't eliminate possibilities of race condition. In 2, it's memory allocation would be slow and it may trigger JIT cancellation frequently. So 1 would be fast for both VM and JIT situations. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-19_mjit_compile_ivar.rb: use PRIuSIZEshyouhei
`ic->ic_value.index` is size_t, not always unsigned long. See also: https://travis-ci.org/ruby/ruby/jobs/443560810#L2263 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-18tool/insns2vm.rb: get rid of expanding pathsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-14_mjit_compile_ivar.erb: optimize setivar as wellk0kubun
mjit_compile.inc.erb: ditto common.mk: update dependency for the rename from getivar.erb === Optcarrot benchmark === ``` $ benchmark-driver benchmark.yml --rbenv '2.0.0::2.0.0-p648 --disable-gems;before::before --disable-gems;before+JIT::before --disable-gems --jit;after::after --disable-gems;after+JIT::after --disable-gems --jit' -v --repeat-count 24 2.0.0: ruby 2.0.0p648 (2015-12-16 revision 53162) [x86_64-linux] before: ruby 2.6.0dev (2018-10-14 trunk 65074) [x86_64-linux] before+JIT: ruby 2.6.0dev (2018-10-14 trunk 65074) +JIT [x86_64-linux] after: ruby 2.6.0dev (2018-10-14 trunk 65074) [x86_64-linux] after+JIT: ruby 2.6.0dev (2018-10-14 trunk 65074) +JIT [x86_64-linux] Calculating ------------------------------------- 2.0.0 before before+JIT after after+JIT Optcarrot Lan_Master.nes 34.434 53.125 84.782 53.321 86.812 fps Comparison: Optcarrot Lan_Master.nes after+JIT: 86.8 fps before+JIT: 84.8 fps - 1.02x slower after: 53.3 fps - 1.63x slower before: 53.1 fps - 1.63x slower 2.0.0: 34.4 fps - 2.52x slower ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-14_mjit_compile_getivar.erb: we may not say receiver [ci skip]k0kubun
for instance variable access, unlike method call. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-14vm_opts.h: share USE_IC_FOR_IVAR as OPT_IC_FOR_IVARk0kubun
with mjit_compile.c (tool/ruby_vm/views/_mjit_compile_getivar.erb). mjit_compile.c: ditto tool/ruby_vm/views/_mjit_compile_getivar.erb: ditto vm_opts.h: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-14_mjit_compile_getivar.erb: optimize IC-hit getivark0kubun
by inlining index (and serial to invalidate that) and simplifying the branch by using JIT cancellation. mjit_compile.inc.erb: use the above file mjit_compile.c: copy USE_IC_FOR_IVAR definition. will move this to another shared file later. common.mk: add new dependency test/ruby/test_jit.rb: cover this case === Optcarrot benchmark === ``` $ benchmark-driver benchmark.yml --rbenv '2.0.0::2.0.0-p648;before::before --disable-gems;before+JIT::before --disable-gems --jit;after::after --disable-gems;after+JIT::after --disable-gems --jit' -v --repeat-count 24 2.0.0: ruby 2.0.0p648 (2015-12-16 revision 53162) [x86_64-linux] before: ruby 2.6.0dev (2018-10-14 trunk 65072) [x86_64-linux] before+JIT: ruby 2.6.0dev (2018-10-14 trunk 65072) +JIT [x86_64-linux] after: ruby 2.6.0dev (2018-10-14 trunk 65072) [x86_64-linux] last_commit=_mjit_compile_getivar.erb: optimize IC-hit getivar after+JIT: ruby 2.6.0dev (2018-10-14 trunk 65072) +JIT [x86_64-linux] last_commit=_mjit_compile_getivar.erb: optimize IC-hit getivar Calculating ------------------------------------- 2.0.0 before before+JIT after after+JIT Optcarrot Lan_Master.nes 36.065 53.896 71.565 53.856 84.747 fps Comparison: Optcarrot Lan_Master.nes after+JIT: 84.7 fps before+JIT: 71.6 fps - 1.18x slower before: 53.9 fps - 1.57x slower after: 53.9 fps - 1.57x slower 2.0.0: 36.1 fps - 2.35x slower ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-24_mjit_compile_send.erb: remove TODO comment solved [ci skip]k0kubun
which was solved by r64820 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-24_mjit_compile_send.erb: refactor code to setup iseqk0kubun
by sharing vm_call_iseq_setup_normal. This is a retry of r64280. vm_insnhelper.c: Remove unused argument `ci` and pass `me` instead of `cc` to share this with JIT. Declare this with ALWAYS_INLINE to make sure this function is inlined in JIT. tool/mk_call_iseq_optimized.rb: deal with the interface change of vm_call_iseq_setup_normal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e