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

1231 Коммитов

Автор SHA1 Сообщение Дата
nobu 1a6ae0a99f Always try to update revision.h with GNU make
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-29 07:07:40 +00:00
shyouhei 493955c692 .travis.yml: cache unicode.org files
Before this changeset (since r58071) we did not download files
from unicode.org but just touch some files.  This is a kind of
hack that people normally don't do at home.

We are caching other files between builds now.  Why not also save
those files downloaded from elsewhere.  This covers more
realistic workload, I guess.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-29 05:26:05 +00:00
nobu b1ad07bd1a common.mk: simplify for ruby.imp
* common.mk (ruby.imp): extract the first word on the next lines
  of MJIT_FUNC_EXPORTED, regardless the prefix.  duplicate symbols
  will be removed by `sort -u`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-26 03:47:47 +00:00
duerst 0889346de5 add several emoji data files to UNICODE_EMOJI_DOWNLOAD for download
In common.mk, add the files emoji-sequences.txt, emoji-test.txt,
emoji-variation-sequences.txt, and emoji-zwj-sequences.txt to
UNICODE_EMOJI_DOWNLOAD for download with `make update-unicode-property-files`.
These files will be used for automated tests for /\X/.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-25 23:16:18 +00:00
hsbt a943328194 Use stub executables generated by RubyGems istead of original executables.
It resolved the conflict issues when invoking `gem i rdoc` and the binstub
issues with Bundler and Rails.

  [Bug #5060][ruby-core:38257][Fix GH-2023]

  * https://github.com/rubygems/rubygems/pull/2338
  * https://github.com/heroku/heroku-buildpack-ruby/issues/829

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-25 01:20:00 +00:00
odaira a5e9182230 * common.mk: revise r65767 because AIX's grep does not support -A
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-24 19:54:32 +00:00
nobu 8c8e72fb8b Add clean-srcs
Add `clean-srcs` target to clean sources in the build directory,
and `realclean-srcs` target to clean autogenerated sources in the
source directory.  Also `realclean-srcs-extra` target to clean
sources which are generatable but need to install extra commands,
in addition.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-24 04:34:00 +00:00
nobu 65cec46e40 Make ext/etc/constdefs.h by srcs-ext
Make platform independent header, ext/etc/constdefs.h, by `make
srcs-ext`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-24 04:33:59 +00:00
duerst b5a1a3aa7c add GraphemeBreakeTests.txt file to UNICODE_PROPERTY_FILES for download
In common.mk, add the file GraphemeBreakeTests.txt to UNICODE_PROPERTY_FILES
to be downloaded. This will be used for automatic tests for /\X/ and
String#each_grapheme_cluster.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-23 23:18:47 +00:00
nobu 2f023c5dba Get rid of variable modifiers of BSD make
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-21 10:09:21 +00:00
nobu f1ed4b713b configure.ac: add --disable-fiber-coroutine option
* configure.ac: add --disable-fiber-coroutine option, and disable
  it on x86-mingw32 for now.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-21 03:26:59 +00:00
nobu 91e6ac3d96 Make coroutine object directory for each arch
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-20 12:02:29 +00:00
nobu 6f59255747 Change ASMEXT to s
By the default of GNU make, .S is used to be compiled with CC, but
we have already used .s as ia64.s, and now coroutine/*/Context.s.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-20 11:45:13 +00:00
nobu 973bcc5953 Fix typo and make directory
* common.mk (coroutine/amd64/Context.$(OBJEXT)): fix a typo,
  $(OBJECT).

* common.mk (coroutine/amd64): recipe to make object directory.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-20 10:29:03 +00:00
samuel 07a324a0f6 Native implementation of coroutines to improve performance of fibers
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-20 09:59:10 +00:00
nobu 27665e5134 common.mk: BTESTS to direct tests by btest
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-20 09:29:37 +00:00
nobu 9cbfb17754 Also clean ruby-runner.o and ruby.imp [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-18 23:29:41 +00:00
nobu 5c334727f1 common.mk: dependency of io.c for r65779
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-18 04:21:52 +00:00
nobu 3c7852f801 common.mk: hack to export symbols for MJIT in ruby.imp
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-16 07:08:58 +00:00
nobu fe7773b933 common.mk: fix the pattern to be hidden
* common.mk (ruby.imp): consider symbol prefix, remove InitVM, and
  fix internal symbols start with a dot.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-16 06:52:01 +00:00
nobu 45295303ac gmake.mk: force updating revision.h
Since `.revision.time` recipe needs `$(BASERUBY)`, it should not
try to get updated unconditionally, or tarballs fail to build on
environments where BASERUBY is not available.

All developers who build frequently use GNU make anyway, don't
you?

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-13 03:24:18 +00:00
k0kubun ceab9f363c common.mk: force updating revision.h on each commit
by making .revision.time PHONY. Prior to this commit, RUBY_DESCRIPTION
has been updated only when version.h (or tool/file2lastrev.rb) is updated.

.revision.time (REVISION_H) target internally has IFCHANGE to update
revision.h. So it doesn't touch revision.h when it's not updated,
and thus it's safe to run every time.

defs/gmake.mk: drop obsoleted reference to REVISION_FORCE

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-13 02:06:51 +00:00
nobu 803dcea481 Revert r65681 which had a race condition issue
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-12 10:19:04 +00:00
nobu 767ab942bc srcs-ext should update ext/ripper/eventids2table.c
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-12 06:56:52 +00:00
nobu 76566bfd58 ruby-runner.c: enable MJIT_SEARCH_BUILD_DIR only if no relative loading
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-07 07:21:00 +00:00
hsbt 59c8d50653 Added bundler as default gems. Revisit [Feature #12733]
* bin/*, lib/bundler/*, lib/bundler.rb, spec/bundler, man/*:
    Merge from latest stable branch of bundler/bundler repository and
    added workaround patches. I will backport them into upstream.
  * common.mk, defs/gmake.mk: Added `test-bundler` task for test suite
    of bundler.
  * tool/sync_default_gems.rb: Added sync task for bundler.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-02 23:07:56 +00:00
ktsj 7deb37777a common.mk: --no-ri and --no-rdoc options were removed
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65508 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-02 22:28:21 +00:00
ko1 dcd0346265 add dependencies to transient_heap.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-01 08:15:42 +00:00
ko1 312b105d0e introduce TransientHeap. [Bug #14858]
* transient_heap.c, transient_heap.h: implement TransientHeap (theap).
  theap is designed for Ruby's object system. theap is like Eden heap
  on generational GC terminology. theap allocation is very fast because
  it only needs to bump up pointer and deallocation is also fast because
  we don't do anything. However we need to evacuate (Copy GC terminology)
  if theap memory is long-lived. Evacuation logic is needed for each type.

  See [Bug #14858] for details.

* array.c: Now, theap for T_ARRAY is supported.

  ary_heap_alloc() tries to allocate memory area from theap. If this trial
  sccesses, this array has theap ptr and RARRAY_TRANSIENT_FLAG is turned on.
  We don't need to free theap ptr.

* ruby.h: RARRAY_CONST_PTR() returns malloc'ed memory area. It menas that
  if ary is allocated at theap, force evacuation to malloc'ed memory.
  It makes programs slow, but very compatible with current code because
  theap memory can be evacuated (theap memory will be recycled).

  If you want to get transient heap ptr, use RARRAY_CONST_PTR_TRANSIENT()
  instead of RARRAY_CONST_PTR(). If you can't understand when evacuation
  will occur, use RARRAY_CONST_PTR().

(re-commit of r65444)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-30 21:53:56 +00:00
ko1 7d359f9b69 revert r65444 and r65446 because of commit miss
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-30 21:01:55 +00:00
ko1 90ac549fa6 introduce TransientHeap. [Bug #14858]
* transient_heap.c, transient_heap.h: implement TransientHeap (theap).
  theap is designed for Ruby's object system. theap is like Eden heap
  on generational GC terminology. theap allocation is very fast because
  it only needs to bump up pointer and deallocation is also fast because
  we don't do anything. However we need to evacuate (Copy GC terminology)
  if theap memory is long-lived. Evacuation logic is needed for each type.

  See [Bug #14858] for details.

* array.c: Now, theap for T_ARRAY is supported.

  ary_heap_alloc() tries to allocate memory area from theap. If this trial
  sccesses, this array has theap ptr and RARRAY_TRANSIENT_FLAG is turned on.
  We don't need to free theap ptr.

* ruby.h: RARRAY_CONST_PTR() returns malloc'ed memory area. It menas that
  if ary is allocated at theap, force evacuation to malloc'ed memory.
  It makes programs slow, but very compatible with current code because
  theap memory can be evacuated (theap memory will be recycled).

  If you want to get transient heap ptr, use RARRAY_CONST_PTR_TRANSIENT()
  instead of RARRAY_CONST_PTR(). If you can't understand when evacuation
  will occur, use RARRAY_CONST_PTR().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-30 20:46: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
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
ko1 b710785f1a add disabling MJIT features option.
* configure.ac: introduce new configure option `--enable-mjit` and
  `--disable-mjit`. Default is "enable".
  `--disable-mjit` disables all of MJIT features so that `ruby --jit`
  can't enable MJIT.
  This option affect a macro `USE_MJIT`.
  This change remove `--enable/disable-install-mjit-header` option.

* Makefile.in: introduce the `ENABLE_MJIT` variable.

* common.mk: use `ENABLE_MJIT` option.

* internal.h: respect `USE_MJIT`. Same as other *.c, *.h.

* test/ruby/test_jit.rb: check `ENABLE_MJIT` key of rbconfg.rb.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20 06:53:00 +00:00
k0kubun 6e11415b9c configure.ac: add --disable-install-mjit-header
and substitute INSTALL_MJIT_HEADER. This would be convenient as a workaround
for user if we found a platform that can't compile Ruby after Ruby 2.6.0 release.

common.mk: Install MJIT header only when INSTALL_MJIT_HEADER
Makefile.in: ditto
win32/Makefile.sub: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-19 12:31:02 +00:00
duerst a5818630f8 revert r65091, r65090 because ci fails
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-16 07:53:37 +00:00
duerst 33b5c610a6 update to Unicode 11.0.0 (basic step, not complete yet)
- common.mk: Change Unicode version to 11.0.0
- enc/unicode/case-folding.rb, enc/unicode.c: Initial changes to deal with
  Gregorian Mtavruli. This should bring us up to the same level as e.g.
  Python 3.7, by following the Unicode tables exactly. But it will
  produce undesirable (mixed-case) results for String#capitalize.
  This will be addressed in a later commit.
- enc/unicode/11.0.0, enc/unicode/11.0.0/casefold.h, enc/unicode/name2ctype.h:
  Add generated files.
- lib/unicode_normalize/tables.rb: Updated table.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-16 07:01:55 +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 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
nobu 262437b457 Remove compile-time dependencies on ruby/version.h
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-13 16:21:06 +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
k0kubun fe0818c49a common.mk: upgrade benchmark_driver
since maybe r64870 implicitly depends on
https://github.com/benchmark-driver/benchmark-driver/pull/47 too.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64883 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-29 07:21:30 +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
normal b0253a7569 thread.c: use rb_hrtime_t scalar for high-resolution time operations
Relying on "struct timespec" was too annoying API-wise and
used more stack space.  "double" was a bit wacky w.r.t rounding
in the past, so now we'll switch to using a 64-bit type.

Unsigned 64-bit integer is able to give us over nearly 585
years of range with nanoseconds.  This range is good enough
for the Linux kernel internal time representation, so it
ought to be good enough for us.

This reduces the stack usage of functions while GVL is held
(and thus subject to marking) on x86-64 Linux (with ppoll):

	rb_wait_for_single_fd    120 => 104
	do_select                120 => 88

[ruby-core:88582] [Misc #15014]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-25 06:58:35 +00:00
mame 664bf8bfc5 common.mk: update "make help" so that "make check" now runs test-spec
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-22 05:24:51 +00:00
nobu 5a336c26cd common.mk: timestamp directory
* common.mk: timestamp files need the timestamp directory.
  [Bug #15015] [ruby-core:88584]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-21 02:02:54 +00:00
k0kubun a48d1d7991 mjit.c: include mjit_worker.c
instead of linking functions with mjit_worker.o.

In the r64285's structure, we needed to publish some variables with
mjit_ prefix. But ideally those variables should be completely private
in mjit.o (or old mjit_worker.o), and it was hard.

So I chose an approach similar to vm*.c for mjit.c and mjit_worker.c.
I believe mjit_compile.c is still nice to be separated.

After this commit, I'll remove the mjit_ prefix again...

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-11 09:37:14 +00:00
k0kubun ddcb40f595 mjit_worker.c: carve out worker-related code
The motivation of this change is to make sure rb_funcall or GC-related
functions are not called on worker-related code. Currently such
functions are used in some places and I believe it's partly because it's
hard to identify which part is called on MJIT worker thread.

Now, mjit.c is safe to use them but we know we need to safely deal with
mjit_compile.c, mjit_worker.c and mjit_internal.h.

mjit_compile.c: update the comment about it

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-11 07:57:58 +00:00
mame 163b830d70 common.mk: "make check" now runs test-spec
Currently there are many "make" targets for testing: test, test-all,
check, exam, etc.
To make it simple, this change makes "make check" run all tests.
"make exam" is just an alias to "make check".
If a new test suite is added in future, "make check" should include it
(unless it takes too much time...)
[Feature #14187]

Also, this introduces "make test-short" as an alias to "make test".
I believe "make test" should equal to "make check", but there is
objection against this.  So now I commit only things that we agreed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-10 08:42:45 +00:00
nobu a40f12b77c common.mk: merge dependencies to wait miniruby to get built
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-10 04:52:24 +00:00
nobu 3ef25ed755 mjit.c: ruby_version is no longer used since r63279
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-10 04:33:11 +00:00
nobu 8778e9267c fix mjit_min_header for universal binary
* common.mk: rules using MJIT_HEADER_SUFFIX, which to be overriden
  in defs/universal.mk, must be in common.mk, not Makefile.in.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-08 14:34:24 +00:00
k0kubun be38f53bae common.mk: stop building MJIT min header for mswin
Since it's impossible to leave macro when preprocessing C source file
with cl.exe, I decided to create precompiled header on Ruby's build time
instead.

We're not doing it for non-mswin environment for 2 reasons:
1) Precompiled header may not be able to be used when CC is upgraded.
2) We need to create as many precompiled headers as the patterns of
   compile options. (Probably only 2, for with and without --jit-debug)

I'll ignore them for mswin for now, and solve it later by including CC
version and --jit-debug information in precompiled header filename.
After that, non-mswin environment may follow it to simplify build system.

Makefile.in: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-04 15:12:30 +00:00
kazu ae83c35b90 Add PRINTF_ARGS to kprintf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-31 15:20:54 +00:00
k0kubun 11974fc010 mjit.c: allow using MJIT header in build directory
when $MJIT_SEARCH_BUILD_DIR is set.

If prefix path is owned by root, `make install` needs to be run by root.
But in general we don't want to run `make test-all`, and also running
`make test-all` currently fails due to permission tests of rdoc and rubygems.
Thus, prior to this commit, specifying a prefix like "/usr/local" could
mean there was no way to pass test-all.

So we should not depend on `make install` for `make test-all`. Thus I
reverted r64104 and r64103, and applied this workaround to pass `make
test-all` without `make install`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-31 12:43:06 +00:00
nobu 93d74cffa0 common.mk: install for test-all iff load-relative is disabled
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-29 11:00:02 +00:00
k0kubun b4705a52d6 common.mk: test-all requires install for now
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-29 10:31:57 +00:00
normal 3943dcd180 use https:// instead of git:// when possible
Avoid MitM when downloading from insecure networks.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-28 03:34:30 +00:00
nobu 727f6ee8ef dsymutil needs the object files
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-24 06:03:02 +00:00
nobu 7c5a79efba exe/ruby: link libm for fiddle test
* common.mk (exe/ruby): $(LIBS) should come after the source file
  due to the ld spec.

* ruby-runner.c (ruby_libm_func): force to link libm for fiddle
  test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-12 02:14:00 +00:00
k0kubun 3e93bf3b46 common.mk: upgrade benchmark_driver
benchmark/README.md: fix help output, which is changed on v0.14.6.
Especially `e1::path1,arg1,...; e2::path2,arg2` part was wrong since `,`
can't be used to split arguments anymore.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-11 00:34:32 +00:00
k0kubun f328fe40b3 benchmark_driver/runner: add runners for metrics
supported by legacy benchmark/driver.rb.

benchmark/README.md: document them

common.mk: update benchmark_driver to correct 0.0 output and to fix
spacing format of `-o simple` and `-o markdown`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-10 15:01:27 +00:00
k0kubun 83c5389439 common.mk: execute benchmark alphabetically
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-10 13:16:55 +00:00
k0kubun 8068d34cfe Revert "benchmark/*.yml: convert from benchmark/bm_*.rb"
This reverts r63900.

Having single-execution benchmark as a normal Ruby script is preferred
by ko1. I'm not a big fan of having inconsistent benchmark formats, but
I can understand some benefits of it.

common.mk: remove obsolsted benchmark-each PHONY declaration, support
running Ruby scripts added by this commit.

README.md: follow ARGS change

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-10 13:05:29 +00:00
k0kubun 12a38cbac0 benchmark: resurrect peak / size metrics
by adding runner plugins for them.

benchmark/lib/benchmark_driver/runner/peak.rb: added peak runner plugin
benchmark/lib/benchmark_driver/runner/size.rb: added size runner plugin
common.mk: allow using them

benchmark/memory_wrapper.rb: deleted in favor of those runner plugins

benchmark/README.md: document them

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-10 12:14:04 +00:00
k0kubun 7bed459a26 benchmark/driver.rb: fully obsolete this
in favor of just using benchmark_driver.gem.

common.mk: The new `make benchmark` covers the both usages for old `make
benchmark` and old `make benchmark-each`. So `make benchmark-each` is
dropped now.

benchmark/README.md: Explain its details

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-09 16:31:35 +00:00
k0kubun 5b9ff71077 common.mk: upgrade benchmark_driver to v0.14
benchmark/driver.rb: deal with breaking changes which are actually
introduced for this driver.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-09 15:45:02 +00:00
nobu bf9169d555 common.mk: codesign ruby-runner too
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-09 01:50:12 +00:00
k0kubun dc8327d79a benchmark/driver.rb: drop legacy Ruby script support
Now all benchmarks are converted to YAMLs.

common.mk: Drop obsoleted bm_* pattern

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-08 17:48:58 +00:00
k0kubun 3293322a39 benchmark: introduce benchmark_driver.gem
Makefile.in: Clone benchmark-driver repository in benchmark/benchmark-driver
  `make update-benchmark-driver`, like simplecov.
win32/Makefile.sub: Roughly do the same thing.
.gitignore: Ignore the cloned repository.
common.mk: Trigger `make update-benchmark-driver` to run `make benchmark`
  and adjust arguments for benchmark_driver.gem.

benchmark/require.yml: renamed from benchmark/bm_require.rb, benchmark/prepare_require.rb
benchmark/require_thread.yml: renamed from benchmark/bm_require_thread.rb, benchmark/prepare_require_thread.rb
benchmark/so_count_words.yml: renamed from benchmark/bm_so_count_words.rb, benchmark/prepare_so_count_words.rb,
  benchmark/wc.input.base
benchmark/so_k_nucleotide.yml: renamed from benchmark/bm_so_k_nucleotide.rb, benchmark/prepare_so_k_nucleotide.rb,
  benchmark/make_fasta_output.rb
benchmark/so_reverse_complement.yml: renamed from benchmark/bm_so_reverse_complement.rb, benchmark/prepare_so_reverse_complement.rb,
  benchmark/make_fasta_output.rb

I'm sorry but I made some duplications between benchmark/require.yml and benchmark/require_thread.yml,
and between benchmark/so_k_nucleotide.yml and benchmark/so_reverse_complement.yml.

If you're not comfortable with it, please combine these YAMLs to share
the same prelude. One YAML file can have multiple benchmark definitions
sharing prelude.

benchmark/driver.rb: Replace its core feature with benchmark_driver.gem.
  Some old features are gone for now, but I'll add them again later.

[Misc #14902]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-08 14:38:05 +00:00
k0kubun 1f4541cb98 common.mk: load prelude on `make benchmark`
because benchmark/bm_io_nonblock_noex.rb and benchmark/bm_io_nonblock_noex2.rb
are using IO#write_nonblock and it's defined in prelude.

miniruby can't run the benchmark without prelude.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-08 14:08:25 +00:00
k0kubun d081b3c62d common.mk: drop obsoleted `make tbench`
benchmark/bmx_* files haven't existed since r37263 and thus it runs
nothing.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-08 02:25:46 +00:00
naruse 1d74de37e3 ruby tool/update-deps --fix
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-05 12:48:45 +00:00
nobu 05c0c57d51 EXTOBJS should be included in DLDOBJS
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-17 02:42:46 +00:00
nobu dc1f272ee6 common.mk: dependency of node_name.inc
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-08 10:42:48 +00:00
hsbt afbf10e8c6 Added missing dependency for ast.c.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63545 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-01 13:10:37 +00:00
yui-knk 46463af983 Define AST module under RubyVM [experimental]
* ext/-test-/ast/ast.c: Rename to ast.c
  and define AST module under RubyVM.
* common.mk: compile ast.c.
* ext/-test-/ast/extconf.rb: Don't need this file anymore.
* inits.c (rb_call_inits): Call Init_ast to setup AST module.
* test/-ext-/ast/test_ast.rb: Follow up the namespace change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-31 06:13:06 +00:00
usa db5a6ee4ac rename temporary dummy target
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-22 12:24:43 +00:00
usa 0ff7fed70f mention about `goruby` target in help
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-21 12:36:22 +00:00
usa 2eebf5a17e now can do `make goruby`
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-21 12:32:40 +00:00
usa 90a5e34a97 should propagate V to sub make
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-20 18:36:42 +00:00
usa 9fe9ffb842 goruby build was broken
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-20 18:13:08 +00:00
k0kubun 6dd4657fc2 _mjit_compile_send.erb: retry inlining attr_reader
This reverts r63249 (revert r63212) and fixes a bug in it. The test to
prevent the bug is added as well.

vm_insnhelper.c: add `index` argument to vm_getivar. The argument is
created so that MJIT can pass the value of `cc->aux.index` on compilation
time.  The cache invalidation in _mjit_compile_send_guard.erb is only
working for the cache value on compilation time.
Note: As `index` is always passed as constant and it's force-inlined,
the performance of `vm_getivar` won't be degraded in VM.

_mjit_compile_send_guard.erb: New. Used to invalidate inlined values of cc.
common.mk: update dependencies for _mjit_compile_send_guard.erb

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-03 08:47:32 +00:00
mame 0d492003b0 common.mk: Update dependencies on tool/ruby_vm scripts
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-02 02:07:26 +00:00
nobu 13dc8e4ef0 mjit_config.h: expand min header name
* Makefile.in, win32/Makefile.sub (mjit_config.h): expand min
  header name, including the version number and the suffix.

* mjit.c (init_header_filename): the version number and the suffix
  are now included in the header name.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-28 01:45:52 +00:00
k0kubun f84efbaa0f revert r63212
except test_jit.rb.

In some situations, this generates a wrong code. I'll add a test for it
later but let me revert this to make it work for now.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-23 16:20:45 +00:00
k0kubun e72a86fc93 _mjit_compile_send.erb: inline attr_reader call
_mjit_compile_send_guard.erb: carve out the shared logic to invalidate
inlined method call

common.mk: update dependency for this change

test_jit.rb: add test for attr_reader optimization

* Benchmark

```
require 'benchmark_driver'

Benchmark.driver do |x|
  x.prelude %{
    class C
      attr_reader :a
      def initialize
        @a = 1
      end
    end

    o = C.new

    def l o
      i = 0
      while i < 1000000
        o.a
        i += 1
      end
    end
  }
  x.report 'aread', %{ l o }
  x.loop_count 1000

  x.rbenv 'before', 'before,--jit', 'after,--jit'
  x.verbose
end
```

```
before: ruby 2.6.0dev (2018-04-20 trunk 63211) [x86_64-linux]
before,--jit: ruby 2.6.0dev (2018-04-20 trunk 63211) +JIT [x86_64-linux]
after,--jit: ruby 2.6.0dev (2018-04-20 trunk 63211) +JIT [x86_64-linux]
last_commit=_mjit_compile_send.erb: inline attr_reader call
Calculating -------------------------------------
                         before  before,--jit  after,--jit
               aread     54.597       122.894      218.574 i/s -      1.000k times in 18.316102s 8.137089s 4.575106s

Comparison:
                            aread
         after,--jit:       218.6 i/s
        before,--jit:       122.9 i/s - 1.78x  slower
              before:        54.6 i/s - 4.00x  slower

```

* Optcarrot

A little made faster?

fps: 71.35 -> 72.11

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-20 13:42:08 +00:00
nobu d3c5746bbb gmake.mk: expand MJIT header rules
* defs/gmake.mk: expand MJIT header file rules for each
  architectures.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-16 02:07:43 +00:00
k0kubun 8a15857a7f mjit_compile.c: use local variables for stack
if catch_except_p is FALSE. If catch_except_p is TRUE, stack values
should be on VM's stack when exception is thrown and the JIT-ed frame
is re-executed by VM's exception handler. If it's FALSE, the JIT-ed
frame won't be re-executed and don't need to keep values on VM's stack.

Using local variables allows us to reduce cfp->sp motion. Moving cfp->sp
is needed only for insns whose handles_frame? is false. So it improves
performance.

_mjit_compile_insn.erb: Prepare `stack_size` variable for GET_SP,
STACK_ADDR_FROM_TOP, TOPN macros. Share pc and sp motion partial view.
Use cancel handler created in mjit_compile.c.

_mjit_compile_send.erb: ditto. Also, when iseq->body->catch_except_p is
TRUE, this stops to call mjit_exec directly. I described the reason in
vm_insnhelper.h's comment for EXEC_EC_CFP.

_mjit_compile_pc_and_sp.erb: Shared logic for moving sp and pc. As you
can see from thsi file, when status->local_stack_p is TRUE and
insn.handles_frame? is false, moving sp is skipped. But if
insn.handles_frame? is true, values should be rolled back to VM's stack.
common.mk: add dependency for the file

_mjit_compile_insn_body.erb: Set sp value before canceling JIT on
DISPATCH_ORIGINAL_INSN. Replace GET_SP, STACK_ADDR_FROM_TOP, TOPN macros
for the case ocal_stack_p is TRUE and insn.handles_frame? is false.
In that case, values are not available on VM's stack and those macros
should be replaced.

mjit_compile.inc.erb: updated comments of macros which are supported by
JIT compiler. All references to `cfp->sp` should be replaced and thus
INC_SP, SET_SV, PUSH are no longer supported for now, because they are
not used now.

vm_exec.h: moved EXEC_EC_CFP definition to vm_insnhelper.h because it's
tighly coupled to CALL_METHOD.

vm_insnhelper.h: Have revised EXEC_EC_CFP definition moved from vm_exec.h.
Now it triggers mjit_exec for VM, and has the guard for catch_except_p
on JIT-ed code. See comments for details. CALL_METHOD delegates
triggering mjit_exec to EXEC_EC_CFP.

insns.def: Stopped using EXEC_EC_CFP for the case we don't want to
trigger mjit_exec. Those insns (defineclass, opt_call_c_function) are
not supported by JIT and it's safe to use RESTORE_REGS(), NEXT_INSN().
expandarray is changed to pass GET_SP() to replace the macro in
_mjit_compile_insn_body.erb.

vm_insnhelper.c: change to take sp for the above reason.

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

This patch resurrects the performance which was attached in
[Feature #14235].

* Benchmark

Optcarrot (with configuration for benchmark_driver.gem)
https://github.com/benchmark-driver/optcarrot

$ benchmark-driver benchmark.yml --verbose 1 --rbenv 'before;before+JIT::before,--jit;after;after+JIT::after,--jit' --repeat-count 10
before: ruby 2.6.0dev (2018-03-04 trunk 62652) [x86_64-linux]
before+JIT: ruby 2.6.0dev (2018-03-04 trunk 62652) +JIT [x86_64-linux]
after: ruby 2.6.0dev (2018-03-04 local-variable.. 62652) [x86_64-linux]
last_commit=mjit_compile.c: use local variables for stack
after+JIT: ruby 2.6.0dev (2018-03-04 local-variable.. 62652) +JIT [x86_64-linux]
last_commit=mjit_compile.c: use local variables for stack
Calculating -------------------------------------
                         before  before+JIT       after   after+JIT
           optcarrot     53.552      59.680      53.697      63.358 fps

Comparison:
                        optcarrot
           after+JIT:        63.4 fps
          before+JIT:        59.7 fps - 1.06x  slower
               after:        53.7 fps - 1.18x  slower
              before:        53.6 fps - 1.18x  slower

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-04 07:04:40 +00:00
nobu e6faeff381 common.mk: clean timestamp and intermediate header
[ci-skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-28 13:32:29 +00:00
nobu 71ee64a5b1 common.mk: added missing dependencies on id.h
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-27 14:22:57 +00:00
k0kubun 171c496e50 version.c: show +JIT when --jit is passed
in version output.
version.h: ditto
ruby.c: propagate option for it
common.mk: updated dependency for version.c

mjit.c: overwrites the RUBY_DESCRIPTION to have +JIT when --jit is passed

test/ruby/test_rubyoptions.rb: add test for them

Only `ruby --jit -v` will have "+JIT", but this is intentional.
This may not be convenient for debugging by ticket with `ruby -v`,
but it's convenient for benchmark tools that pass options (--jit)
when showing it. At least such behavior is planned for benchmark_driver.gem
and this behavior is designed for it. Other benchmark tools are
recommended to follow the behavior too if they show version.
RUBY_DESCRIPTION might be useful for it too.

The position of "+JIT" is changed from original proposal because other
platforms like JRuby and TruffleRuby end it with archtecture.
It's made similar to JRuby, but it's upper-cased because Matz made approval
for "+JIT" in the ticket.

Example:
$ ruby -v
ruby 2.6.0dev (2018-02-22 trunk 62529) [x86_64-linux]
$ ruby --jit -v
ruby 2.6.0dev (2018-02-22 trunk 62529) +JIT [x86_64-linux]

After --jit is made default in the future, this output may be removed.
So do not rely on this output if possible.

[Feature #14462]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-22 14:53:17 +00:00
nobu fe5d65f157 common.mk: moved macros to mjit_config.h
* Makefile.in, common.mk, win32/Makefile.sub: moved MJIT macros to
  mjit_config.h from XCFLAGS.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-20 02:37:28 +00:00
nobu a4f2606b2d LIBRUBY_A with exts
* Makefile.in, win32/Makefile.sub (LIBRUBY_A): link with extension
  libraries if EXTSTATIC is set, so that static-ruby would work
  too.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-17 05:52:21 +00:00
nobu e28a7c204d separate PRE_LIBRUBY_UPDATE
* Makefile.in, win32/Makefile.sub (PRE_LIBRUBY_UPDATE): separate
  definitions without miniruby.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-17 05:52:20 +00:00
k0kubun 268d9236f6 _mjit_compile_insn_body.erb: refactor
renamed from tool/ruby_vm/views/_mjit_compile_insn_line.erb.
Basically this file should handle everything about macro on JIT.

_mjit_compile_insn.erb: follow the refactoring

common.mk: follow the rename

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-12 07:27:48 +00:00
k0kubun f6cebb97e9 _mjit_compile_insn_line.erb: carve out macro expansion
in _mjit_compile_insn.erb to this file. As I'm going to add macro
expansions later, I want to separate such complex things from whole insn
compilation.

_mjit_compile_insn.erb: _mjit_compile_insn_line.erb part was removed.

common.mk: updated build system for them.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-12 06:54:25 +00:00
k0kubun 29777e308c common.mk: add comments about r62355 [ci skip]
transform_mjit_header.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-11 05:29:13 +00:00
k0kubun 3b6bb3deef common.mk: define MJIT_HEADER earlier
so that other predefined macros won't be removed by
`MJITHeader.remove_predefined_macros!`.

Currently macro like -DVM_CHECK_MODE=2 is removed when it's passed in
configure. But it is needed during JIT compilation.

gc.c: export rb_obj_info to let JIT succeed with VM_CHECK_MODE=2.

```
MJIT warning: failure in loading code from '/tmp/_ruby_mjit_p15631u0.so': /tmp/_ruby_mjit_p15631u0.so: undefined symbol: rb_obj_info
```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-11 04:20:32 +00:00
nobu f6ca5edf3e mjit_config.h
* Makefie.in, win32/Makefile.sub: make mjit_config.h from
  configured variables, including necessary options, e.g., `-m32`
  for 32bit binary on 64bit platform.

* mjit.c: always use configured CC command.  as config.h depends
  on the compiler, different compilers cannot work.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-10 06:22:38 +00:00