Moved this hack mark to an argument to `compile_hash`.
> Bad Hack: temporarily mark hash node with flag so
> compile_hash can compile call differently.
and a related VM improvement.
JIT related commits:
* Code size reduction
* Deduplicate functions on JIT compaction 818d6d3336
* Avoid always inlining cold paths of ivar fcd2576290
* Inline only fast path of rb_class_of b16a2aa938
* Eliminate a call instruction on deopt 61b14bb32b
* Cold path partitioning
* Mark method call slow paths as COLDFUNC 0e5a58b6bf
* Mark vm_stackoverflow as NOINLINE COLDFUNC 9d71373c23
* Create mjit_exec_slowpath and mark it as NOINLINE COLDFUNC 083a17a82a
* Primitive.attr! 'inline' / Integer#zero? 7561db8c00
* Kernel#class 946e5cc668
* (more to come...)
* Properly generate opt_send for cfunc cc 7982dc1dfd
* Optimize exivar access b736ea63bd
* Make JIT-ed leave leaf 151f8be40d
* Inline vm_call_cfunc b9d3ceee8f
VM:
* Enable fastpath on invokesuper 5c27681813
* History: https://speakerdeck.com/k0kubun/ruby-3-samituto?slide=40 (in Japanese)
for opt_* insns.
opt_eq handles rb_obj_equal inside opt_eq, and all other cfunc is
handled by opt_send_without_block. Therefore we can't decide which insn
should be generated by checking whether it's cfunc cc or not.
```
$ benchmark-driver -v --rbenv 'before --jit;after --jit' benchmark/mjit_opt_cc_insns.yml --repeat-count=4
before --jit: ruby 2.8.0dev (2020-06-26T05:21:43Z master 9dbc2294a6) +JIT [x86_64-linux]
after --jit: ruby 2.8.0dev (2020-06-26T06:30:18Z master 75cece1b0b) +JIT [x86_64-linux]
last_commit=Decide JIT-ed insn based on cached cfunc
Calculating -------------------------------------
before --jit after --jit
mjit_nil?(1) 73.878M 74.021M i/s - 40.000M times in 0.541432s 0.540391s
mjit_not(1) 72.635M 74.601M i/s - 40.000M times in 0.550702s 0.536187s
mjit_eq(1, nil) 7.331M 7.445M i/s - 8.000M times in 1.091211s 1.074596s
mjit_eq(nil, 1) 49.450M 64.711M i/s - 8.000M times in 0.161781s 0.123627s
Comparison:
mjit_nil?(1)
after --jit: 74020528.4 i/s
before --jit: 73878185.9 i/s - 1.00x slower
mjit_not(1)
after --jit: 74600882.0 i/s
before --jit: 72634507.6 i/s - 1.03x slower
mjit_eq(1, nil)
after --jit: 7444657.4 i/s
before --jit: 7331304.3 i/s - 1.02x slower
mjit_eq(nil, 1)
after --jit: 64710790.6 i/s
before --jit: 49449507.4 i/s - 1.31x slower
```
to make sure :opt_invokebuiltin_delegate_leave doesn't become
:(trace_)opt_invokebuiltin_delegate.
This is to prevent a warning like
> /tmp/ruby/v3/src/trunk-test/test/ruby/test_jit.rb:618: warning:
'opt_invokebuiltin_delegate_leave' insn is not included in the script.
Actual insns are: opt_invokebuiltin_delegate leave
If :return event is specified for a opt_invokebuiltin_delegate_leave
and leave combination, the instructions should be
opt_invokebuiltin_delegate
trace_return
instructions. To make it, opt_invokebuiltin_delegate_leave
instruction will be changed to opt_invokebuiltin_delegate even if
it is not an event target instruction.
In Ruby 2.7.1 SimpeDelegator cannot be used without requiring `delegate` this PR adds the require to the first example for each class so that devs don't have to hunt for what require to use.
While `spec/bundler` and `spec/bundler/` are treated different
targets by GNU make 4, the same target by GNU make 3. The latter
target, ending with a slash, was to run `test-bundler-parallel`,
instead of `spec/bundler/%`.