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

1597 Коммитов

Автор SHA1 Сообщение Дата
Kazuhiro NISHIYAMA 12812c2bdf
Fix test-bundler-parallel errors when out-of-place build 2021-03-25 14:59:15 +09:00
Nobuyoshi Nakada b1149bf305
Make the commit of updated bundled_gems file 2021-02-16 19:54:16 +09:00
Nobuyoshi Nakada 4f47d655e3 Added Thread::Backtrace.limit [Feature #17479] 2021-02-15 18:29:35 +09:00
Takashi Kokubun 27382eb9fc
Add a benchmark-driver runner for Ractor (#4172)
* Add a benchmark-driver runner for Ractor

* Process.clock_gettime(Process:CLOCK_MONOTONIC) could be slow

in Ruby 3.0 Ractor

* Fetching Time could also be slow

* Fix a comment

* Assert overriding a private method
2021-02-10 21:24:25 -08:00
Samuel Williams 5f69a7f604
Expose scheduler as public interface & bug fixes. (#3945)
* Rename `rb_scheduler` to `rb_fiber_scheduler`.

* Use public interface if available.

* Use `rb_check_funcall` where possible.

* Don't use `unblock` unless the fiber was non-blocking.
2021-02-09 19:39:56 +13:00
Nobuyoshi Nakada 0dd38902b9
Ignore warnings when transforming preprocessed header
For already preprocessed header, -Werror=misleading-indentation
doesn't make sense.
2021-02-01 18:16:39 +09:00
Nobuyoshi Nakada ed6dc066b6
CFLAGS includes ARCH_FLAG 2021-01-26 22:19:00 +09:00
Nobuyoshi Nakada 4de228b6bc
Sort autogenerated dependencies [ci skip] 2021-01-23 20:56:15 +09:00
Nobuyoshi Nakada 899b950647
Remove common output directory 2021-01-22 18:37:31 +09:00
Takashi Kokubun 5cf6229ee9
Skip updating exts in also test-spec to reduce the turnaround time (#4089)
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>

Partially reversing a4f3e1762a like 21df4dce53.
We usually run them through make check which has the dependency, and test-all and test-spec without the dependency are useful for running only individual tests.
2021-01-18 07:14:02 -08:00
Nobuyoshi Nakada 2adbf01ae1
dtoa.c: make thread-safe by using atomic CAS 2021-01-10 18:19:53 +09:00
Koichi Sasada e91160f757 set RUBY_ON_BUG on runruby rule.
set RUBY_ON_BUG='gdb -x $(srcdir)/.gdbinit -p' to catch SEGV
on `make runruby` rule.
2021-01-05 16:50:00 +09:00
Nobuyoshi Nakada 3adf84a079
Commented out the sh-specific code, in cmd.exe 2021-01-05 11:53:41 +09:00
Takashi Kokubun cf4a6b5e7b
Add a missing dependency 2021-01-03 22:48:13 -08:00
Takashi Kokubun 4182035e27
Add -v to make benchmark
I simply can't tell which of compare-ruby and built-ruby is what.
2021-01-01 18:41:22 -08:00
S.H daec5f9edc
Improve performance some Float methods [Feature #17498] (#4018) 2021-01-01 18:39:07 -08:00
Nobuyoshi Nakada 93735f8fc0
Moved time.rb to timev.rb 2020-12-31 17:23:37 +09:00
Nobuyoshi Nakada d5fb51d2d3
Add time.rb as builtin 2020-12-31 15:19:06 +09:00
Nobuyoshi Nakada 2f42243bce Make more silent when -s on GNU make 2020-12-29 17:45:19 +09:00
Nobuyoshi Nakada d57c5a7b61 transcode-tblgen.rb: make silent a little when just -v 2020-12-29 17:45:19 +09:00
Takashi Kokubun c0a2d322c6
Update help of sync-default-gems 2020-12-28 23:03:04 -08:00
Nobuyoshi Nakada 2556cd3f51 Bypass check for warning_category on internal calls 2020-12-28 12:44:03 +09:00
Nobuyoshi Nakada a042043487
Do not include external library sources into packages 2020-12-27 23:33:56 +09:00
Nobuyoshi Nakada 6ed6b85ece Expose atomic operation macros with RUBY prefix
Now we need atomic operations, which are lighter than mutex, more
widely for extension libraries because of Ractor.
2020-12-24 11:43:21 +09:00
Koichi Sasada a2950369bd TracePoint.new(&block) should be ractor-local
TracePoint should be ractor-local because the Proc can violate the
Ractor-safe.
2020-12-22 00:03:00 +09:00
Koichi Sasada 6be61ab264 should use owned_p instead of locked_p
It should raise an error if the same thread tris to call
receive/receive_if.
2020-12-21 02:39:34 +09:00
Koichi Sasada c58142134c make RB_DEBUG_COUNTER_INC()_thread-safe 2020-12-17 03:43:59 +09:00
Kenta Murata 1bafb3cb47
[memory_view] Make MemoryView API Ractor-safe (#3911)
* memory_view.c: make Ractor-safe

* test/ruby/test_memory_view.rb: Add test_ractor

* memory_view: fix typo

* memory_view.c: Use st_update in unregster_exported_object

* memory_view: update dependency
2020-12-16 13:43:56 +09:00
Koichi Sasada 0b678cc9e5 add vm_sync debug counters
* vm_sync_lock
* vm_sync_lock_enter
* vm_sync_lock_enter_nb
* vm_sync_lock_enter_cr
* vm_sync_barrier
2020-12-16 10:38:12 +09:00
Alan Wu 25a48b703e Update dependencies 2020-12-14 17:56:42 -05:00
Koichi Sasada 70a311fdeb trap on non-main ractor
trap can accept blopck/Proc and it can violate Rator isolation,
so the Proc should be isolatable when trap is used on non-main ractor.
2020-12-12 08:36:52 +09:00
Koichi Sasada ad6573163f add RUNOPT and RUNOPT0 for dev rules.
run, runruby, ... accept RUNOPT and RUNOPT0 configuration to pass
some commandline argument like that:

  $(BTESTRUBY) $(RUNOPT0) $(TESTRUN_SCRIPT) $(RUNOPT)

RUNOPT0 is options for ruby interpreter (-w, -v, ...)
RUNOPT is options for the script (ARGV/ARGF)
2020-12-11 11:57:25 +09:00
Hiroshi SHIBATA 087ac34fb2 Added tool/lib into test-spec loadpath 2020-12-10 18:06:25 +09:00
Kenta Murata fad3023e94
Fix ArithmeticSequence#last and ArithmeticSequence#each for non-integer sequences (#3870)
[Bug #17218]
[ruby-core:100312]
2020-12-09 18:48:59 +09:00
Samuel Williams 2553c5f94a Add support for non-blocking `Process.wait`. 2020-12-09 08:55:35 +13:00
Koichi Sasada 307732ccee cancel theap on multi-ractors
accessing theap needs complicating synchronization but it reduce
performance on multi-ractor mode. So simply stop using theap
on multi-ractor mode. In future, theap should be replaced with
more cleaver memory strategy.
2020-12-07 08:28:36 +09:00
Nobuyoshi Nakada 967ed35bbb
Moved update-bundled_gems code to a tool 2020-12-06 16:11:09 +09:00
Samuel Williams 3b5b309b7b Proposed method for dealing with stack locals which have non-local lifetime. 2020-12-05 11:38:56 +13:00
Nobuyoshi Nakada 9e94cd18fc
test-bundled-gems: select bundled gems to test by BUNDLED_GEMS 2020-12-02 17:06:09 +09:00
Koichi Sasada 67693d8d80 ractor local storage C-API
To manage ractor-local data for C extension, the following APIs
are defined.

* rb_ractor_local_storage_value_newkey
* rb_ractor_local_storage_value
* rb_ractor_local_storage_value_set
* rb_ractor_local_storage_ptr_newkey
* rb_ractor_local_storage_ptr
* rb_ractor_local_storage_ptr_set

At first, you need to create a key of storage by
rb_ractor_local_(value|ptr)_newkey().
For ptr storage, it accepts the type of storage,
how to mark and how to free with ractor's lifetime.

rb_ractor_local_storage_value/set are used to access a VALUE
and rb_ractor_local_storage_ptr/set are used to access a pointer.

random.c uses this API.
2020-12-01 09:39:30 +09:00
Nobuyoshi Nakada b4e21ce25c
Clean temproray directory created by test-spec 2020-11-30 18:27:46 +09:00
Nobuyoshi Nakada d92f427d5a
Clean static-ruby 2020-11-30 18:27:45 +09:00
Kenta Murata 73a337e214
Keep references of memory-view-exported objects (#3816)
* memory_view.c: remove a reference in view->obj at rb_memory_view_release

* memory_view.c: keep references of memory-view-exported objects

* Update common.mk

* memory_view.c: Use st_update
2020-11-30 14:53:13 +09:00
Takashi Kokubun 0a2b987696
Make --disable-jit-support compile
vm_core.h needs to be included to know rb_execution_context_t, etc.
I also added a trivial refactoring in mjit.c and missing dependency for
process.c.
2020-11-22 20:55:33 -08:00
Takashi Kokubun 55866565c2
Combine mjit.h and internal/mjit.h
It's very hard to remember which mjit.h has what.
2020-11-22 20:22:21 -08:00
Nobuyoshi Nakada eb3906c6b8
dist: added DISTOPTS and PKGSDIR 2020-11-22 11:32:22 +09:00
Koichi Sasada 5e3259ea74 fix public interface
To make some kind of Ractor related extensions, some functions
should be exposed.

* include/ruby/thread_native.h
  * rb_native_mutex_*
  * rb_native_cond_*
* include/ruby/ractor.h
  * RB_OBJ_SHAREABLE_P(obj)
  * rb_ractor_shareable_p(obj)
  * rb_ractor_std*()
  * rb_cRactor

and rm ractor_pub.h
and rename srcdir/ractor.h to srcdir/ractor_core.h
    (to avoid conflict with include/ruby/ractor.h)
2020-11-18 03:52:41 +09:00
Samuel Williams 5b3572b5ae Update dependencies 2020-11-07 23:39:50 +13:00
Nobuyoshi Nakada 3cb03a00a8
Include c_escape.rb in COMPILE_PRELUDE
template/prelude.c.tmpl requires tool/ruby_vm/helpers/c_escape.rb.
2020-10-26 09:05:08 +09:00
Koichi Sasada 2f50936cb9 Ractor.make_shareable(obj)
Introduce new method Ractor.make_shareable(obj) which tries to make
obj shareable object. Protocol is here.

(1) If obj is shareable, it is shareable.
(2) If obj is not a shareable object and if obj can be shareable
    object if it is frozen, then freeze obj. If obj has reachable
    objects (rs), do rs.each{|o| Ractor.make_shareable(o)}
    recursively (recursion is not Ruby-level, but C-level).
(3) Otherwise, raise Ractor::Error. Now T_DATA is not a shareable
    object even if the object is frozen.

If the method finished without error, given obj is marked as
a sharable object.

To allow makng a shareable frozen T_DATA object, then set
`RUBY_TYPED_FROZEN_SHAREABLE` as type->flags. On default,
this flag is not set. It means user defined T_DATA objects are
not allowed to become shareable objects when it is frozen.

You can make any object  shareable by setting FL_SHAREABLE flag,
so if you know that the T_DATA object is shareable (== thread-safe),
set this flag, at creation time for example. `Ractor` object is one
example, which is not a frozen, but a shareable object.
2020-10-21 07:59:24 +09:00
Koichi Sasada 99310e3eb5 Some global variables can be accessed from ractors
Some global variables should be used from non-main Ractors.
[Bug #17268]

```ruby
     # ractor-local (derived from created ractor): debug
     '$DEBUG' => $DEBUG,
     '$-d' => $-d,

     # ractor-local (derived from created ractor): verbose
     '$VERBOSE' => $VERBOSE,
     '$-w' => $-w,
     '$-W' => $-W,
     '$-v' => $-v,

     # process-local (readonly): other commandline parameters
     '$-p' => $-p,
     '$-l' => $-l,
     '$-a' => $-a,

     # process-local (readonly): getpid
     '$$'  => $$,

     # thread local: process result
     '$?'  => $?,

     # scope local: match
     '$~'  => $~.inspect,
     '$&'  => $&,
     '$`'  => $`,
     '$\''  => $',
     '$+'  => $+,
     '$1'  => $1,

     # scope local: last line
     '$_' => $_,

     # scope local: last backtrace
     '$@' => $@,
     '$!' => $!,

     # ractor local: stdin, out, err
     '$stdin'  => $stdin.inspect,
     '$stdout' => $stdout.inspect,
     '$stderr' => $stderr.inspect,
```
2020-10-20 15:38:54 +09:00
Yusuke Endoh c05e41035c Bundle typeprof gem as bundled gems 2020-10-20 13:03:11 +09:00
Koichi Sasada f6661f5085 sync RClass::ext::iv_index_tbl
iv_index_tbl manages instance variable indexes (ID -> index).
This data structure should be synchronized with other ractors
so introduce some VM locks.

This patch also introduced atomic ivar cache used by
set/getinlinecache instructions. To make updating ivar cache (IVC),
we changed iv_index_tbl data structure to manage (ID -> entry)
and an entry points serial and index. IVC points to this entry so
that cache update becomes atomically.
2020-10-17 08:18:04 +09:00
Koichi Sasada fad97f1f96 sync generic_ivtbl
generic_ivtbl is a process global table to maintain instance variables
for non T_OBJECT/T_CLASS/... objects. So we need to protect them
for multi-Ractor exection.

Hint: we can make them Ractor local for unshareable objects, but
      now it is premature optimization.
2020-10-14 16:36:55 +09:00
Koichi Sasada 11c2f0f36c sync enc_table and rb_encoding_list
enc_table which manages Encoding information. rb_encoding_list
also manages Encoding objects. Both are accessed/modified by ractors
simultaneously so that they should be synchronized.

For enc_table, this patch introduced GLOBAL_ENC_TABLE_ENTER/LEAVE/EVAL
to access this table with VM lock. To make shortcut, three new global
variables global_enc_ascii, global_enc_utf_8, global_enc_us_ascii are
also introduced.

For rb_encoding_list, we split it to rb_default_encoding_list (256 entries)
and rb_additional_encoding_list. rb_default_encoding_list is fixed sized Array
so we don't need to synchronized (and most of apps only needs it). To manage
257 or more encoding objects, they are stored into rb_additional_encoding_list.
To access rb_additional_encoding_list., VM lock is needed.
2020-10-14 14:02:06 +09:00
Nobuyoshi Nakada a9ff390870
Fixed installation failure [Bug #17191]
Try update and extract bundled gems only when baseruby is
available.  It should be done only when installing from
developemental build and not from the tarball, but it is not
obvious to differentiate them.
2020-09-29 13:41:59 +09:00
Nobuyoshi Nakada b971f141b2
Fix up dependencies on internal/sanitizers.h 2020-09-29 13:14:54 +09:00
NARUSE, Yui 4e31cbc070 update-deps
https://github.com/ruby/ruby/runs/1169621878
2020-09-26 18:55:00 +09:00
Kenta Murata 890bc2cdde
Buffer protocol proposal (#3261)
* Add buffer protocol

* Modify for some review comments

* Per-object buffer availability

* Rename to MemoryView from Buffer and make compilable

* Support integral repeat count in memory view format

* Support 'x' for padding bytes

* Add rb_memory_view_parse_item_format

* Check type in rb_memory_view_register

* Update dependencies in common.mk

* Add test of MemoryView

* Add test of rb_memory_view_init_as_byte_array

* Add native size format test

* Add MemoryView test utilities

* Add test of rb_memory_view_fill_contiguous_strides

* Skip spaces in format string

* Support endianness specifiers

* Update documentation

* Support alignment

* Use RUBY_ALIGNOF

* Fix format parser to follow the pack format

* Support the _ modifier

* Parse count specifiers in get_format_size function.

* Use STRUCT_ALIGNOF

* Fix test

* Fix test

* Fix total size for the case with tail padding

* Fix rb_memory_view_get_item_pointer

* Fix rb_memory_view_parse_item_format again
2020-09-25 20:32:02 +09:00
Kazuhiro NISHIYAMA 8705dba194 Update dependencies 2020-09-25 19:21:36 +09:00
Hiroshi SHIBATA ba889100d8
Bundle rbs gem as bundled gems (#3496)
* Added rbs as bundled gems
* Added the missing dependencies for rbs gem
2020-09-23 10:59:49 +09:00
Samuel Williams 501fff14c7 When setting current thread scheduler to nil, invoke `#close`. 2020-09-21 09:51:33 +12:00
Koichi Sasada 3b159374a2 sync ruby_global_symbols
ruby_global_symbols can be accessed with multiple ractors so that
the accesses should be synchronized.
2020-09-18 14:17:49 +09:00
Koichi Sasada e81d7189a0 sync fstring pool
fstring pool should be sync with other Ractors.
2020-09-15 00:04:59 +09:00
Samuel Williams 3dc0fc11f0 Update dependencies 2020-09-14 16:44:09 +12:00
Samuel Williams d387029f39 Standardised scheduler interface. 2020-09-14 16:44:09 +12:00
Nobuyoshi Nakada af5e87ab21 separate rb_random_t
* random.c: separate abstract rb_random_t and rb_random_mt_t for
  Mersenne Twister implementation.

* include/ruby/random.h: the interface for extensions of Random
  class.

* DLL imported symbol reference is not constant on Windows.

* check if properly initialized.
2020-09-07 20:08:01 +09:00
Nobuyoshi Nakada 170c7528e6
common.mk: UNALIGNED_MEMBER_ACCESS needs internal/warnings.h on some platforms 2020-09-05 23:16:26 +09:00
Nobuyoshi Nakada d7406ccc2c
Updated dependency 2020-09-04 16:28:40 +09:00
Koichi Sasada 79df14c04b Introduce Ractor mechanism for parallel execution
This commit introduces Ractor mechanism to run Ruby program in
parallel. See doc/ractor.md for more details about Ractor.
See ticket [Feature #17100] to see the implementation details
and discussions.

[Feature #17100]

This commit does not complete the implementation. You can find
many bugs on using Ractor. Also the specification will be changed
so that this feature is experimental. You will see a warning when
you make the first Ractor with `Ractor.new`.

I hope this feature can help programmers from thread-safety issues.
2020-09-03 21:11:06 +09:00
Hiroshi SHIBATA 377159370b Revert the workaround of minitest and hoe
86737c509c
  3e1aea4613
2020-09-01 11:21:41 +09:00
Hiroshi SHIBATA 86737c509c Removed minitest and hoe because they didn't support Ruby 3 yet 2020-08-31 18:51:59 +09:00
卜部昌平 490010084e sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
卜部昌平 756403d775 sed -i '/r_cast.h/d' 2020-08-27 15:03:36 +09:00
卜部昌平 0da2a3f1fc sed -i '\,2/extern.h,d' 2020-08-27 14:07:49 +09:00
卜部昌平 d2eeb83634 tool/update-deps -fix 2020-08-19 14:30:57 +09:00
卜部昌平 4d7818a299 tool/update-deps --fix 2020-08-15 12:09:26 +09:00
Nobuyoshi Nakada c904844578
Skip already extracted gems 2020-07-29 20:52:47 +09:00
卜部昌平 2e5a711f47 common.mk: add missing dependency 2020-07-13 12:45:26 +09:00
Nobuyoshi Nakada 358f91bf6f
Skip comment and empty lines in gems/bundled_gems file 2020-07-05 18:59:06 +09:00
Takashi Kokubun 946e5cc668
Annotate Kernel#class as inline (#3250)
```
$ benchmark-driver -v --rbenv 'before;after;before --jit;after --jit' benchmark/mjit_class.yml --repeat-count=4
before: ruby 2.8.0dev (2020-06-23T07:09:54Z master 37a2e48d76) [x86_64-linux]
after: ruby 2.8.0dev (2020-06-23T17:29:56Z inline-class 0ff147c007) [x86_64-linux]
before --jit: ruby 2.8.0dev (2020-06-23T07:09:54Z master 37a2e48d76) +JIT [x86_64-linux]
after --jit: ruby 2.8.0dev (2020-06-23T17:29:56Z inline-class 0ff147c007) +JIT [x86_64-linux]
Calculating -------------------------------------
                         before       after  before --jit  after --jit
    mjit_class(self)    39.219M     40.060M       53.502M      69.202M i/s -     40.000M times in 1.019915s 0.998495s 0.747631s 0.578021s
       mjit_class(1)    39.567M     41.242M       52.100M      68.895M i/s -     40.000M times in 1.010935s 0.969885s 0.767749s 0.580591s

Comparison:
                 mjit_class(self)
         after --jit:  69201690.7 i/s
        before --jit:  53502336.4 i/s - 1.29x  slower
               after:  40060289.1 i/s - 1.73x  slower
              before:  39218939.2 i/s - 1.76x  slower

                    mjit_class(1)
         after --jit:  68895358.6 i/s
        before --jit:  52100353.0 i/s - 1.32x  slower
               after:  41241993.6 i/s - 1.67x  slower
              before:  39567314.0 i/s - 1.74x  slower
```
2020-06-23 23:49:03 -07:00
Takashi Kokubun 8838600c1e
Stop relying on `make benchmark`'s `-I$(srcdir)/benchmark/lib`
These days I don't use `make benchmark`. The YAML files should be
executable with bare `benchmark-driver` CLI without passing
`RUBYOPT=-Ibenchmark/lib`.
2020-06-22 00:17:10 -07:00
Takashi Kokubun 95b0fed371
Make Integer#zero? a separated method and builtin (#3226)
A prerequisite to fix https://bugs.ruby-lang.org/issues/15589 with JIT.
This commit alone doesn't make a significant difference yet, but I thought
this commit should be committed independently.

This method override was discussed in [Misc #16961].
2020-06-20 14:55:09 -07:00
Nobuyoshi Nakada f3e081c6b6
Build configured extension libraries only
Consider the libraries, which remain exts.mk but not listed in
ext/configure-ext.mk, removed.
2020-06-19 15:35:14 +09:00
Nobuyoshi Nakada cc46d514dc
$(PREP) is needed to run $(MINIRUBY) 2020-06-18 01:42:12 +09:00
Nobuyoshi Nakada ccb7a4b9f2
Replaced accessors of `Struct` with `invokebuiltin` 2020-06-17 08:18:46 +09:00
Nobuyoshi Nakada 318d52e820
Revert "Replaced accessors of `Struct` with `invokebuiltin`"
This reverts commit 19cabe8b09,
which didn't support tool/lib/iseq_loader_checker.rb.
2020-06-16 18:44:58 +09:00
Nobuyoshi Nakada 19cabe8b09
Replaced accessors of `Struct` with `invokebuiltin` 2020-06-16 18:24:02 +09:00
Nobuyoshi Nakada 1f1b62fb7b
Added install-dbg
Scripts to run the interpreter via debugger.
2020-06-13 08:22:06 +09:00
Nobuyoshi Nakada 5349506eb4
Updated autogenerated dependencies
Sorted the lines asnd added mjit_build_dir.o dependencies.
2020-06-11 18:06:29 +09:00
Nobuyoshi Nakada 21df4dce53
Skip updating exts in test-all to reduce the turnaround time 2020-06-10 19:42:27 +09:00
Nobuyoshi Nakada 465b5dc124
Fixed main dependency
`programs` has depended on the "fake" script, which is used by
`test-spec` and etc.
2020-06-08 13:15:05 +09:00
Nobuyoshi Nakada a4f3e1762a
Fixed test dependencies
All tests of `test-all` or more require not only the `main` but
also extension libraries.
2020-06-08 12:38:58 +09:00
Nobuyoshi Nakada b12197dbbb
Updated the benchmark-driver version 2020-06-08 09:25:53 +09:00
Nobuyoshi Nakada d0b2332e93
Defaulted benchmark output to markdown with comarison 2020-06-08 09:25:22 +09:00
Nobuyoshi Nakada e11ffe0aaf
Fixup test-bundler-parallel
* Do not chdir in the runner process, to access miniruby.  Chdir
  in worker processes instead.
* GNU make does not export newly added environment variables by
  default, set PARALLEL_TESTS_EXECUTABLE in the runner.
2020-06-05 21:34:26 +09:00
Hiroshi SHIBATA 0afbfddc0d
Fixup 347127794e 2020-06-05 19:20:48 +09:00
Hiroshi SHIBATA 347127794e
spec/bundler/support/parallel.rb is no longer used parallel_rspec. 2020-06-05 19:01:39 +09:00
Nobuyoshi Nakada 2b7454eb92
Update leaked-globals [Bug #16934]
* match uppercase types which would be global, other than [BDT]
* ignore `RUBY_` prefixed symbols
2020-06-04 17:00:52 +09:00
Nobuyoshi Nakada 047471c529
No GITPULLOPTIONS by default
To honor the environment variable, keep GITPULLOPTIONS unset by
default, and appended the option to VCSUP.
2020-06-04 13:16:24 +09:00
Nobuyoshi Nakada 93ccb8e8a2
Remove platform directory when distclean or more [ci skip]
At the time of clean-platform, platform directory may not be empty
because of parallel build.
2020-05-28 00:13:11 +09:00
Hiroshi SHIBATA 777b5b4f39 Bump version to use RSpec 3.8+ 2020-05-13 07:54:37 +09:00
Hiroshi SHIBATA cf9619084b Bump version to use Rake 13 in bundler examples 2020-05-13 07:54:37 +09:00
Nobuyoshi Nakada 1c4eb70654
Build auxiliary program files early 2020-05-12 23:19:20 +09:00
Nobuyoshi Nakada 2383cdabc1
builtin_binary.inc: should be updated even if no changes [ci skip]
As this rule does not use a separate timestamp file, the target
will be rebuilt every time once it is outdated.
2020-05-12 23:07:42 +09:00
卜部昌平 9e41a75255 sed -i 's|ruby/impl|ruby/internal|'
To fix build failures.
2020-05-11 09:24:08 +09:00
卜部昌平 d7f4d732c1 sed -i s|ruby/3|ruby/impl|g
This shall fix compile errors.
2020-05-11 09:24:08 +09:00
卜部昌平 50a6d292c0 nmake doesn't understand $<
Fix MSVC build error.
2020-05-10 16:51:10 +09:00
卜部昌平 4fca592e8c delete mk_builtin_binary.rb
To generate what is necessary via generic_erb.rb instead.
2020-05-10 16:51:10 +09:00
卜部昌平 191cfcc407 delete mk_call_iseq_optimized.rb
To generate what is necessary via generic_erb.rb instead.
2020-05-10 16:51:10 +09:00
Yusuke Endoh 91e4e2403e internal/process.h: add a no-warning simple wrapper for fork(2)
As fork(2) is deprecated, its calls must be guarded by
`COMPILER_WARNING_IGNORED(-Wdeprecated-declarations)`.
All usages of fork(2) in process have been alread guarded.  A new call
to fork(2) was added in ruby.c with f22c4ff359.
This caused a build failure on Solaris 11.

It may hide a bug to guard big code unnecessarily, so this change
introduces a simple wrapper "rb_fork" whose definition is guarded, and
replaces all calls to fork(2) with the wrapper function.
2020-05-02 21:34:10 +09:00
Nobuyoshi Nakada 86431f5075
Remove rubyspec temporary directories 2020-04-28 19:00:33 +09:00
Nobuyoshi Nakada 3497152515
Remove rubyspec temporary directory 2020-04-28 15:05:59 +09:00
Nobuyoshi Nakada a217d3cedc
check: compare with right upstream 2020-04-27 01:04:05 +09:00
Nobuyoshi Nakada d6ec8da689
Update benchmark-driver version 2020-04-22 16:13:42 +09:00
Nobuyoshi Nakada 5ce7835520
Update benchmark-driver version 2020-04-22 10:01:11 +09:00
Nobuyoshi Nakada 00d9278387
fileutils now depends on rbconfig.rb due to JRuby support 2020-04-17 14:07:14 +09:00
Nobuyoshi Nakada 9fa24018b7
Make y.output in ripper unlocalized [ci skip]
Often it is easy to search, grep, etc from command line, for
debugging purpose.
2020-04-14 13:10:28 +09:00
卜部昌平 c37a357c13 include what you use.
This reverts commit 443389effc.
This reverts commit d94960f22e.

Inclusion of header files must be explicit.  Every file shall directly
include what is necessary.

https://github.com/include-what-you-use/include-what-you-use says:

> When every file includes what it uses, then it is possible to edit any
> file and remove unused headers, without fear of accidentally breaking
> the upwards dependencies of that file. It also becomes easy to
> automatically track and update dependencies in the source code.

Though we don't use iwyu itself, the principle quoted above is a good
thing that we can agree.

Now that include guards were added to every and all of the headers
inside of our project this changeset does not increase compile time, at
least on my machine.
2020-04-13 16:06:00 +09:00
Koichi Sasada d94960f22e update dependencies 2020-04-10 14:53:25 +09:00
卜部昌平 9e6e39c351
Merge pull request #2991 from shyouhei/ruby.h
Split ruby.h
2020-04-08 13:28:13 +09:00
Nobuyoshi Nakada 310054b240 Moved `Dir.open` and `Dir#initialize` to dir.rb 2020-04-06 22:22:25 +09:00
Nobuyoshi Nakada 21d0b40de2 Added tooldir variable 2020-04-05 09:26:57 +09:00
Nobuyoshi Nakada f2807f4ec0
Refresh revision.h by after-update 2020-03-30 16:03:38 +09:00
Kazuhiro NISHIYAMA 930b012ad9
Add rexml to fix rss of test-bundled-gems (#2976) 2020-03-24 15:36:53 +09:00
Takashi Kokubun 5c4847f191
Use miniruby to run tool/mjit_tabs.rb
hoping to fix https://github.com/ruby/actions/runs/527422022
2020-03-23 22:44:57 -07:00
Takashi Kokubun 5b3157a511
Make file names and variable names consistent 2020-03-23 22:33:01 -07:00
Nobuyoshi Nakada 6ab3664635
Moved MJIT_WITHOUT_TABS default to configure.ac
And then the environment variable.
2020-03-24 13:46:00 +09:00
Takashi Kokubun 13e9551b97
Change the filename like make variable
for consistency
2020-03-22 23:15:50 -07:00
Takashi Kokubun 3bd7d5617f
Make the first argument slightly more robust 2020-03-22 23:14:32 -07:00
Takashi Kokubun d578f1d3ea
Change the run_without_tabs switching to dedicated
variable of make instead of d059714746 as requested.

You can disable this like `make MJIT_WITHOUT_TABS=false` or
`export MJIT_WITHOUT_TABS=false`.
2020-03-22 23:12:54 -07:00
Takashi Kokubun d059714746
Disable run_without_tabs when there's no -ggdb3
in debugflags, as requested by nobu

I actually wanted to check debugflags directly rather than MJIT_DEBUGFLAGS
because debugflags is always used but MJIT_DEBUGFLAGS may not be always used.
But I couldn't find a better way to check debugflags.
2020-03-22 20:20:27 -07:00
Takashi Kokubun 9ebf74fd78
Expand tabs for rb_mjit_header.h (#2975)
This is necessary to avoid converting a hard tab to just 1 space in
preprocessor to generate rb_mjit_header.h, which is helpful when using
gdb or perf report.

See also: [Misc #16112]

This reverts commit 91acdd17c4.
Fixed permission failure on Travis, encoding, and added SKIPPED_FILES.
2020-03-22 11:50:45 -07:00
Takashi Kokubun 91acdd17c4
Revert "Expand tabs for rb_mjit_header.h"
This reverts commit 57119dd561.

Temporarily reverting for Travis failures
2020-03-22 00:53:05 -07:00
Takashi Kokubun 57119dd561
Expand tabs for rb_mjit_header.h
I can't live without this when using gdb or perf report.

See also: [Misc #16112]
2020-03-22 00:37:31 -07:00
S.H 290d608637
support builtin for Kernel#clone 2020-03-17 19:37:07 +09:00
Takashi Kokubun 6e405b2611
Use a human-readable funcname with --jit-debug
for perf output like:

Samples: 100K of event 'cycles:ppp', Event count (approx.): 1007750000
  Children      Self  Command  Shared Object             Symbol
+   81.58%     1.47%  ruby     ruby                      [.] rb_vm_exec
+   81.06%     7.61%  ruby     ruby                      [.] vm_exec_core
+   80.16%     0.00%  ruby     ruby                      [.] vm_sendish (inlined)
+   75.03%     0.00%  ruby     ruby                      [.] mjit_exec (inlined)
+   74.37%     0.00%  ruby     ruby                      [.] mjit_exec (inlined)
+   73.42%     0.22%  ruby     _ruby_mjit_p11277u42.so   [.] _mjit42_rack_method_override_rb_call
+   73.25%     0.10%  ruby     _ruby_mjit_p11277u41.so   [.] _mjit41_sinatra_show_exceptions_rb_call
+   73.19%     0.22%  ruby     _ruby_mjit_p11277u44.so   [.] _mjit44_rack_head_rb_call
+   73.03%     0.15%  ruby     _ruby_mjit_p11277u45.so   [.] _mjit45_sinatra_base_rb_call
+   72.87%     0.26%  ruby     _ruby_mjit_p11277u49.so   [.] _mjit49_rack_logger_rb_call
+   70.56%     0.11%  ruby     _ruby_mjit_p11277u40.so   [.] _mjit40_sinatra_base_rb_call
+   68.70%     0.11%  ruby     _ruby_mjit_p11277u39.so   [.] _mjit39_sinatra_base_rb_call
+   68.39%     0.29%  ruby     _ruby_mjit_p11277u56.so   [.] _mjit56_rack_protection_frame_options_rb_call
+   67.89%     0.18%  ruby     _ruby_mjit_p11277u37.so   [.] _mjit37_sinatra_base_rb_block_in_call
+   67.04%     0.16%  ruby     _ruby_mjit_p11277u34.so   [.] _mjit34_sinatra_base_rb_synchronize

Reverting deb1c7b97d, fixing `sprint_funcname`'s argument in `compact_all_jit_code`.
Also updating common.mk.
2020-03-14 21:02:09 -07:00
David Rodríguez 459670d47f Fix bundled gems installation on a fresh clone 2020-03-14 18:16:47 +09:00
Nobuyoshi Nakada 88f4ebac83
Update and extract for each gem 2020-03-13 15:34:50 +09:00
Nobuyoshi Nakada 289bdb64d9
Add prepare-gems to download and extract bundled gems 2020-03-12 22:58:04 +09:00
Takashi Kokubun adcf0316d1
Prevent unloading methods used in root_fiber while calling another Fiber (#2939)
Fixing SEGVs like:
http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2744905
http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2744420
http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2741400
2020-02-28 23:58:33 -08:00
Nobuyoshi Nakada 55bf0ef1aa Share extracted bundled gems with gems for bundler
Extract bundled gems under ".bundle/gems" and get rid of
duplication which cause constant redefinition warnings at
`test-all` after `extract-gems` and `test-bundler`.
2020-02-25 20:40:36 +09:00
Nobuyoshi Nakada 8b6e2685a4
Fixed symbol misused as ID
`rb_funcallv_public` and `rb_respond_to` require an `ID`, not a
`Symbol`.  [Bug #16649]
2020-02-24 15:37:52 +09:00
Nobuyoshi Nakada 0ed3384fd4
Revert "Prefer `exe/ruby` to execute from it"
This reverts commit c7b71af9e2, as
an example in bundler expects untouch PATH.
2020-02-23 13:31:56 +09:00
Nobuyoshi Nakada c7b71af9e2
Prefer `exe/ruby` to execute from it 2020-02-22 16:01:38 +09:00
Koichi Sasada b9007b6c54 Introduce disposable call-cache.
This patch contains several ideas:

(1) Disposable inline method cache (IMC) for race-free inline method cache
    * Making call-cache (CC) as a RVALUE (GC target object) and allocate new
      CC on cache miss.
    * This technique allows race-free access from parallel processing
      elements like RCU.
(2) Introduce per-Class method cache (pCMC)
    * Instead of fixed-size global method cache (GMC), pCMC allows flexible
      cache size.
    * Caching CCs reduces CC allocation and allow sharing CC's fast-path
      between same call-info (CI) call-sites.
(3) Invalidate an inline method cache by invalidating corresponding method
    entries (MEs)
    * Instead of using class serials, we set "invalidated" flag for method
      entry itself to represent cache invalidation.
    * Compare with using class serials, the impact of method modification
      (add/overwrite/delete) is small.
    * Updating class serials invalidate all method caches of the class and
      sub-classes.
    * Proposed approach only invalidate the method cache of only one ME.

See [Feature #16614] for more details.
2020-02-22 09:58:59 +09:00
Koichi Sasada f2286925f0 VALUE size packed callinfo (ci).
Now, rb_call_info contains how to call the method with tuple of
(mid, orig_argc, flags, kwarg). Most of cases, kwarg == NULL and
mid+argc+flags only requires 64bits. So this patch packed
rb_call_info to VALUE (1 word) on such cases. If we can not
represent it in VALUE, then use imemo_callinfo which contains
conventional callinfo (rb_callinfo, renamed from rb_call_info).

iseq->body->ci_kw_size is removed because all of callinfo is VALUE
size (packed ci or a pointer to imemo_callinfo).

To access ci information, we need to use these functions:
vm_ci_mid(ci), _flag(ci), _argc(ci), _kwarg(ci).

struct rb_call_info_kw_arg is renamed to rb_callinfo_kwarg.

rb_funcallv_with_cc() and rb_method_basic_definition_p_with_cc()
is temporary removed because cd->ci should be marked.
2020-02-22 09:58:59 +09:00
Hiroshi SHIBATA 05485868cb Workaround for bison provided by scoop on mswin environment 2020-02-15 21:20:25 +09:00
Nobuyoshi Nakada 985d1b9ec4
Fixed a potential memory leak
`rb_str_new_cstr` can raise a `NoMemoryError`.
2020-02-12 11:58:56 +09:00
Nobuyoshi Nakada e3e96e3faa
Check if bindable against the refined target [Bug #16617] 2020-02-09 20:13:49 +09:00