Граф коммитов

1291 Коммитов

Автор SHA1 Сообщение Дата
k0kubun 51a0f04e6b _mjit_compile_send.erb: do not inline tailcall ISeq
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-30 14:57:03 +00:00
shyouhei c80f3f709f less verbose code by sharing attribute definitions
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-29 03:21:22 +00:00
shyouhei 08e47ab98a bare_instructions.rb: sort attributes [ci skip]
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-29 02:07:52 +00:00
hsbt a509de06bc Added initialization task for default gems.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-25 10:16:28 +00:00
k0kubun 97f3e426a1 _mjit_compile_ivar.erb: cancel on undefined ivar
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-24 15:41:14 +00:00
k0kubun fd35cb44b8 _mjit_compile_send.erb: fix wrong cc usages
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-23 12:01:34 +00:00
k0kubun a35eb0cc7d mjit.c: remove wrongly-committed debug code
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-21 14:30:18 +00:00
k0kubun 13df05acfa mjit.c: copy call cache values to MJIT worker
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 14:23:24 +00:00
k0kubun 480eccbb35 _mjit_compile_send.erb: don't split send_guard
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-21 13:37:13 +00:00
k0kubun 1b5aa4f516 mjit.c: copy inline cache values to MJIT worker
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-21 13:21:28 +00:00
k0kubun 00ecff9f78 revert r65213 and r65215
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-20 10:20:49 +00:00
ko1 0b19e15a12 rename configure option `--disable-mjit` to `--disable-mjit-support`
* configure.ac: rename configure option `--disable-mjit` to
  `--disable-mjit-support` because `--disable-mjit` is ambiguous that
  runtime MJIT default enable option or supporting MJIT features.
  `ENABLE_MJIT` is also renamed to `MJIT_SUPPORT`

* Makefile.in: catch up this fix.

* common.mk: ditto.

* test/ruby/test_jit.rb: ditto.

* win32/Makefile.sub: catch up this fix on mswin.

* tool/mkconfig.rb: fix to pass `MJIT_SUPPORT` key.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20 08:00:42 +00:00
k0kubun 8449f4992b vm_insnhelper.c: never cache getinstancevariable twice
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-20 07:43:50 +00:00
hsbt 8d3b2631ba Cleanup fiddle extenstion when sync them from github repo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20 07:21:14 +00:00
nobu a9025c8841 transform_mjit_header.rb: fix up r65169
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-19 13:11:33 +00:00
nobu 5a8b81fdd3 transform_mjit_header.rb: `inline` may be a macro
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-19 12:29:47 +00:00
nobu 15d0180b6e transform_mjit_header.rb: add system_header pragma
* tool/transform_mjit_header.rb: insert GCC system_header pragma
  to get rid of errors caused by the contents included from system
  headers.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-19 12:29:46 +00:00
shyouhei 1b30f57c8f _mjit_compile_ivar.rb: use PRIuSIZE
`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-19 07:48:45 +00:00
nobu 3c83a94ea9 tool/insns2vm.rb: get rid of expanding paths
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-18 23:58:21 +00:00
nobu f80c80f004 make-snapshot: package with TarHeader
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-18 06:36:30 +00:00
usa 6db7b1c55a remove message already unnecesary
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-18 00:54:32 +00:00
k0kubun c312111c7c tool/downloader.rb: retry Net::ReadTimeout
as failed in
https://ci.appveyor.com/project/ruby/ruby/builds/19540849/job/9p9pq0b7hfrb2r8q

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-16 09:29:23 +00:00
k0kubun 83e1b361c8 _mjit_compile_ivar.erb: optimize setivar as well
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 13:25:21 +00:00
k0kubun 3ac55870aa _mjit_compile_getivar.erb: we may not say receiver [ci skip]
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-14 11:50:52 +00:00
k0kubun 589d80e7e3 vm_opts.h: share USE_IC_FOR_IVAR as OPT_IC_FOR_IVAR
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 11:25:36 +00:00
k0kubun f89fe59db4 _mjit_compile_getivar.erb: optimize IC-hit getivar
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-10-14 09:24:43 +00:00
k0kubun 0fd5f063aa win32/Makefile.sub: generate MJIT header pdb
in the MJIT-header-specific path, not default path like vc140.pdb.

mjit_worker.c: specify the MJIT-header-specific pdb path.

tool/rbinstall.rb: install MJIT header pdb as well.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-11 16:28:04 +00:00
k0kubun 34ade9a4b7 win32/Makefile.sub: install MJIT header and object
to prefix. This is a retry of r64947. So this doesn't still make mswin MJIT
on install directory succeed. One more step required.

tool/rbinstall.rb: This change is needed to install headers correctly since
the extensions are .obj and .pch, not .h


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-11 15:01:56 +00:00
shyouhei 1af6418742 support --with-arch=x86_64h
Recent apple machines describe themselves being x86_64h.  That
architecture is somehow supported by their C compiler and at least
by recent clang.  However config.sub does not know that fact so
making universal binary targeting it is rejected by the program.

Why not skip the check by config.sub.  [fix GH-1971]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-03 04:49:34 +00:00
nobu 92b469e7da Install HTML docs if produced
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-02 01:56:43 +00:00
nobu a0ff2a6aaf Expand gemspec path to the real path
`make install` has loaded forwardable.rb twice, from
forwardable.gemspec and prime.gemspec.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-29 07:04:29 +00:00
k0kubun 6e62e59eec revert r64847, r64846 and r64839
because r64849 seems to fix issues which we were confused about.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-26 02:38:45 +00:00
k0kubun e08f418230 revert r64838 and r64839
because some build failures persisted

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-26 01:11:20 +00:00
k0kubun 08c9f030f6 Revert "Revert r64824 to fix build failure on AppVeyor"
This reverts commit r64829. I'll prepare another temporary fix, but I'll
separately commit that to make it easier to revert that later.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-25 17:19:51 +00:00
k0kubun f00bf24272 Revert r64824 to fix build failure on AppVeyor
AppVeyor msys2/MinGW build started to fail like:
https://ci.appveyor.com/project/ruby/ruby/build/9722/job/b94kixi004klmye3

Until I can investigate that, I revert this for now.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-25 04:03:35 +00:00
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
k0kubun 7a18e2982e _mjit_compile_send.erb: remove TODO comment solved [ci skip]
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 06:21:19 +00:00
k0kubun 36265861b9 _mjit_compile_send.erb: refactor code to setup iseq
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
2018-09-24 06:09:55 +00:00
nobu 04a353fe02 tool/enc-unicode.rb: rewrote without flip-flop
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-22 20:39:35 +00:00
nobu d00199a139 darwin-cc: hide ld warnings
* tool/darwin-cc: ld in Apple's recent Xcode warns text-based stub
  files, which are probably caused by Apple's broken package.
  hide such (and architecture deprecation) warnings during
  configuration to pass TRY_LDFLAGS.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-21 07:19:13 +00:00
shyouhei d6d444d6b2 fix typo [ci skip]
This error does not happen right now so this typo is
not serious, unless you locally edit insns.def.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-20 05:31:51 +00:00
k0kubun 62327bb6ff vm_insnhelper.h: rename CI_SET_FASTPATH to CC_SET_FASTPATH
because it's actually setting fastpath to cc instead of ci since r51903.

vm_insnhelper.c: ditto
mjit_compile.c: ditto
tool/ruby_vm/views/_mjit_compile_send.erb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-18 12:48:28 +00:00
k0kubun 433c2714a1 common.mk: ruby tool/update-deps --fix
tool/update-deps: tweak the comment to make sure it should be built in
the source directory, because building ruby outside source directory
failed on my trial.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-17 01:31:06 +00:00
shyouhei 9c6bd0d840 move ADD_PC around (take 2)
Now that we can say for sure if an instruction calls a method or
not internally, it is now possible to reroute the bugs that
forced us to revert the "move PC around" optimization.

First try: r62051
Reverted:  r63763
See also:  r63999

----

trunk: ruby 2.6.0dev (2018-09-13 trunk 64736) [x86_64-darwin15]
ours: ruby 2.6.0dev (2018-09-13 trunk 64736) [x86_64-darwin15]
last_commit=move ADD_PC around (take 2)
Calculating -------------------------------------
                           trunk        ours
         so_ackermann      1.884       2.278 i/s -       1.000 times in 0.530926s 0.438935s
             so_array      1.178       1.157 i/s -       1.000 times in 0.848786s 0.864467s
      so_binary_trees      0.176       0.177 i/s -       1.000 times in 5.683895s 5.657707s
       so_concatenate      0.220       0.221 i/s -       1.000 times in 4.546896s 4.518949s
       so_count_words      6.729       6.470 i/s -       1.000 times in 0.148602s 0.154561s
         so_exception      3.324       3.688 i/s -       1.000 times in 0.300872s 0.271147s
          so_fannkuch      0.546       0.968 i/s -       1.000 times in 1.831328s 1.033376s
             so_fasta      0.541       0.547 i/s -       1.000 times in 1.849923s 1.827091s
      so_k_nucleotide      0.800       0.777 i/s -       1.000 times in 1.250635s 1.286295s
             so_lists      2.101       1.848 i/s -       1.000 times in 0.475954s 0.541095s
        so_mandelbrot      0.435       0.408 i/s -       1.000 times in 2.299328s 2.450535s
            so_matrix      1.946       1.912 i/s -       1.000 times in 0.513872s 0.523076s
    so_meteor_contest      0.311       0.317 i/s -       1.000 times in 3.219297s 3.152052s
             so_nbody      0.746       0.703 i/s -       1.000 times in 1.339815s 1.423441s
       so_nested_loop      0.899       0.901 i/s -       1.000 times in 1.111767s 1.109555s
            so_nsieve      0.559       0.579 i/s -       1.000 times in 1.787763s 1.726552s
       so_nsieve_bits      0.435       0.428 i/s -       1.000 times in 2.296282s 2.333852s
            so_object      1.368       1.442 i/s -       1.000 times in 0.731237s 0.693684s
      so_partial_sums      0.616       0.546 i/s -       1.000 times in 1.623592s 1.833097s
          so_pidigits      0.831       0.832 i/s -       1.000 times in 1.203117s 1.202334s
            so_random      2.934       2.724 i/s -       1.000 times in 0.340791s 0.367150s
so_reverse_complement      0.583       0.866 i/s -       1.000 times in 1.714144s 1.154615s
             so_sieve      1.829       2.081 i/s -       1.000 times in 0.546607s 0.480562s
      so_spectralnorm      0.524       0.558 i/s -       1.000 times in 1.908716s 1.792382s



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-14 07:44:44 +00:00
k0kubun 26a11ae771 Revert "vm_insnhelper.h: simplify EXEC_EC_CFP implementation"
This reverts commit r64711, because EXEC_EC_CFP on JIT-ed code does not
call jit_func with the patch when catch_except_p is true. It wasn't intentional.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-13 07:12:07 +00:00
k0kubun bada0d24eb vm_insnhelper.h: simplify EXEC_EC_CFP implementation
and possibly memory access for iseq->body may be reduced.

No significant impact for performance on Optcarrot.

* before
fps: 55.03865935187656
fps: 57.16854675983188
fps: 57.672458407661765
fps: 58.28989837869383
fps: 58.80503815099268
fps: 59.068054176528534
fps: 59.55736806358244
fps: 61.01018920533034
fps: 63.34167049232186
fps: 65.20575018321766
fps: 65.46758316561318

* after
fps: 55.21860411005677
fps: 55.34840351179166
fps: 58.23666596747484
fps: 59.71987124578901
fps: 61.131485120234935
fps: 61.279905164649485
fps: 61.66060774175459
fps: 64.11215576508765
fps: 64.63699742853154
fps: 65.28260058920769
fps: 65.85447796482678

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-13 06:39:40 +00:00
shyouhei 6925c9c6f5 move canary-related statements into macros
This is mostly cosmetic.  Should generate a slightly readable
vm.inc output.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-13 03:46:46 +00:00
k0kubun f7b0a791ca _mjit_compile_pc_and_sp.erb: forget about memcpy [ci skip]
because using memcpy here actually made performance worse.
In Optcarrot,

* for loop
fps: 55.90428960597268
fps: 57.21690379342434
fps: 58.41751168279789
fps: 58.7317470613203
fps: 62.81371000202459
fps: 63.02541045417479
fps: 63.77324026366317
fps: 65.48067818347447
fps: 66.02324323831398
fps: 66.3816048847424
fps: 66.54526488660156

* memcpy
fps: 54.98389812126847
fps: 57.96524857391357
fps: 57.974918725327946
fps: 58.285987089087364
fps: 58.639003211333225
fps: 59.03244214601948
fps: 59.89964772199603
fps: 60.809490242786175
fps: 62.462070790624146
fps: 62.534599002918306
fps: 63.787312566163756

That's probably because the copied size is very small.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-12 13:32:11 +00:00
k0kubun 0325145f4c _mjit_compile_insn.erb: move pc on JIT cancel
if and only if it's not moved yet, to avoid potential bugs in the future.

_mjit_compile_send.erb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-11 15:14:56 +00:00
k0kubun 6e3fe890d5 bare_instructions.rb: use Hash#fetch to read attr
to raise descriptive KeyError instead of NoMethodError in case these
attrs are accidentally removed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-11 14:10:00 +00:00