64552 Commits

Author SHA1 Message Date
Marc-Andre Lafortune
53ce71b5af Ractor.select requires an argument or yield_value 2020-12-07 02:21:12 -05:00
Koichi Sasada
c2fa024e02 fix Thread's interrupt and Ractor#take issue
Thread's interrupt set Ractor's wakeup_status as interrupted, but
the status remains next Ractor communication API. This patch makes
to ignore the previous interrupt state.
[Bug #17366]

Also this patch solves the Thread#kill and Ractor#take issues.
2020-12-07 16:01:35 +09:00
卜部昌平
cc36e499f9 Doxygen terminology update [ci skip]
Follow N2328 http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2328.pdf
2020-12-07 14:20:44 +09:00
Masaki Matsushita
5d8bcc4870 Revert getaddrinfo_a()
getaddrinfo_a() gets stuck after fork().
To avoid this, we need 1 second sleep to wait for internal
worker threads of getaddrinfo_a() to be finished, but that is unacceptable.

[Bug #17220] [Feature #17134] [Feature #17187]
2020-12-07 13:33:53 +09:00
Koichi Sasada
1ba05f5b2d need more lock in finalize_list()
Some data should be accessed in parallel so they should be protected
by the lock.
2020-12-07 13:32:50 +09:00
Takashi Kokubun
556a728508
Lock active_units references on compaction
This might race with mjit_recompile.
2020-12-06 20:23:32 -08:00
Yusuke Endoh
4b4af40f55
Update TypeProf to 0.9.0 (#3856)
* Update TypeProf to 0.9.0
2020-12-07 11:57:27 +09:00
Koichi Sasada
0ebf6bd0a2 RB_VM_LOCK_ENTER_NO_BARRIER
Write barrier requires VM lock because it accesses VM global bitmap
but RB_VM_LOCK_ENTER() can invoke GC because another ractor can wait
to invoke GC and RB_VM_LOCK_ENTER() is barrier point. This means that
before protecting by a write barrier, GC can invoke.
To prevent such situation, RB_VM_LOCK_ENTER_NO_BARRIER() is introduced.
This lock primitive does not become GC barrier points.
2020-12-07 11:27:25 +09:00
Koichi Sasada
8dd03e5cf0 skip assertion on multi-ractor
This assertion is not considerred on multi-ractor mdoe.
2020-12-07 11:10:18 +09:00
Koichi Sasada
bef3eb5440 fix decl of ruby_single_main_ractor
On windows, MJIT doesn't work without this patch because of
the declaration of ruby_single_main_ractor. This patch fix this
issue and move the definition of it from ractor.c to vm.c to locate
near place of ruby_current_vm_ptr.
2020-12-07 08:28:36 +09:00
Koichi Sasada
344ec26a99 tuning trial: newobj with current ec
Passing current ec can improve performance of newobj. This patch
tries it for Array and String literals ([] and '').
2020-12-07 08:28:36 +09:00
Koichi Sasada
59ddb88da6 RB_EC_NEWOBJ_OF
NEWOBJ with current ec.
2020-12-07 08:28:36 +09:00
Koichi Sasada
91d99025e4 per-ractor object allocation
Now object allocation requires VM global lock to synchronize objspace.
However, of course, it introduces huge overhead.
This patch caches some slots (in a page) by each ractor and use cached
slots for object allocation. If there is no cached slots, acquire the global lock
and get new cached slots, or start GC (marking or lazy sweeping).
2020-12-07 08:28:36 +09:00
Koichi Sasada
1d0bf3d8dd log for the beggining of vm_lock_enter
Before this patch, there is no information to start locking.
2020-12-07 08:28:36 +09:00
Koichi Sasada
554a7180a0 RB_VM_LOCK_ENTER_CR_LEV
This is variant of RB_VM_LOCK_ENTER_LEV, but accept current racotr's
pointer.
2020-12-07 08:28:36 +09:00
Koichi Sasada
23f9447429 show ractor info on non-single ractor mode
Without this patch, Ruby doesn't show ractor's information when
there is only 1 ractor. However it is hard to read the log when
some ractors are created and terminated. This patch makes to keep
showing ractor's information on multi-ractor mode.
2020-12-07 08:28:36 +09: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
Koichi Sasada
b67b24d0f5 ruby_single_main_ractor for single ractor mode
ruby_multi_ractor was a flag that indicates the interpreter doesn't
make any additional ractors (single ractor mode).
Instead of boolean flag, ruby_single_main_ractor pointer is introduced
which keeps main ractor's pointer if single ractor mode. If additional
ractors are created, ruby_single_main_ractor becomes NULL.
2020-12-07 08:28:36 +09:00
Kenta Murata
60eabb1aa7
Revert "memory_view.c: Add rb_memory_view_extract_item_members"
This reverts the following three commits.

- ce707079c153f389d861c91a8dccc510fab0e245
- 1a76bb56b0ba99a19d1373c4c8ebac42e7b6f27c
- 51500eedefa492699668ced3e07e330a9a4d53ee
2020-12-07 00:38:19 +09:00
git
f9fd99e601 * 2020-12-07 [ci skip] 2020-12-07 00:19:45 +09:00
Kenta Murata
ce707079c1
memory_view.c: suppress uninitialized warning 2020-12-07 00:19:25 +09:00
Nobuyoshi Nakada
e427c5cc2a
Update rbs 2020-12-06 23:48:03 +09:00
Kenta Murata
1a76bb56b0
memory_view.c: Fix the argument type of rb_memory_view_extract_item_members 2020-12-06 23:24:45 +09:00
Kenta Murata
51500eedef
memory_view.c: Add rb_memory_view_extract_item_members 2020-12-06 22:46:06 +09:00
Nobuyoshi Nakada
14580ebef9
Update rbs 2020-12-06 22:19:36 +09:00
Nobuyoshi Nakada
3184cd85c7
Updated bundled gems 2020-12-06 16:11:10 +09:00
Nobuyoshi Nakada
e4e2a33560
update-bundled_gems: support recent format, keep the tag to test 2020-12-06 16:11:10 +09:00
Nobuyoshi Nakada
ea9f16a27f
update-bundled_gems: chomp ".git" suffix from the source code URI 2020-12-06 16:11:09 +09:00
Nobuyoshi Nakada
967ed35bbb
Moved update-bundled_gems code to a tool 2020-12-06 16:11:09 +09:00
Jeremy Evans
18b2ce11b5 Mentioned numbered parameter assignment is a SyntaxError in NEWS [ci skip]
Requested by Junichi Ito.
2020-12-05 22:31:52 -08:00
MSP-Greg
5d07a21ccd RubyGems certs - remove AddTrust, add GlobalSign Root R3 2020-12-06 14:53:54 +13:00
Masaki Matsushita
76439eee68 Call cleanup function for getaddrinfo_a(3) only before fork()
Previously, rb_getaddrinfo_a_before_exec() is called from before_exec().
However, the function needs to be called only before fork().
The change moves it to before_fork().
2020-12-06 01:32:43 +09:00
git
a38d447356 * 2020-12-06 [ci skip] 2020-12-06 01:05:14 +09:00
Masaki Matsushita
c56a1c1953 Extend sleep time to 1.5 second in rb_getaddrinfo_a_before_exec()
After 94d49ed31c, TestSocket#test_getaddrinfo_after_fork fails in some
platforms. To avoid this, the change extends sleep time to 1.5 second.
2020-12-06 01:01:13 +09:00
Benoit Daloze
9dbb2bfd73 Wrap SortedSet with ruby_version_is ""..."3.0"
* Using $ spec/mspec/tool/wrap_with_guard.rb 'ruby_version_is ""..."3.0"' spec/ruby/library/set/sortedset/**/*_spec.rb
2020-12-05 11:40:00 +01:00
Benoit Daloze
bb3d705819 Add MSpec tool to automatically wrap spec files with a guard 2020-12-05 11:39:33 +01:00
Benoit Daloze
d0bd43c332 Revert "SortedSet was removed at a3db08d7b6ff119223f77e3df00b4f6deac971e2"
* This reverts commit b06ffce4aef002dc47c3c5968181230e7ab8d7cc.
* Do not revert specs, wrap them with `ruby_version_is` (tool for that in next commit).
2020-12-05 11:17:22 +01:00
Masaki Matsushita
5e58a9033f Reduce timeout of test_getaddrinfo_after_fork 2020-12-05 17:43:35 +09:00
Nobuyoshi Nakada
d2b7e1e4b2
Protoized old pre-ANSI K&R style definitions 2020-12-05 14:57:31 +09:00
Marc-Andre Lafortune
a83a51932d [ruby/matrix] Optimize **
Avoiding recursive call would imply iterating bits starting from
most significant, which is not easy to do efficiently.
Any saving would be dwarfed by the multiplications anyways.
[Feature #15233]
2020-12-05 00:56:58 -05:00
Samuel Williams
3b5b309b7b Proposed method for dealing with stack locals which have non-local lifetime. 2020-12-05 11:38:56 +13:00
Samuel Williams
15e23312f6 Rework the order of operations to avoid stack smashing. 2020-12-05 11:38:56 +13:00
Robert Schulze
f4386413f1 Cope with frozen-string-literal
When running irb 1.2.1 (2019-12-24) with frozen-string-literal enabled, it crashes in reline with `can't modify frozen String (FrozenError)`

Steps to reproduce: 

`RUBYOPT="--enable-frozen-string-literal" irb`
2020-12-05 03:14:42 +09:00
aycabta
0cf073088e [ruby/reline] Process insertion buffer forcibly
https://github.com/ruby/reline/commit/89d49ec9e0
2020-12-05 02:58:59 +09:00
aycabta
c2bd5b84d0 [ruby/reline] Support bracketed paste mode
https://github.com/ruby/reline/commit/d1a6869322
2020-12-05 02:58:59 +09:00
aycabta
7624f52757 [ruby/reline] Forced newline insertion is not just cursor moving
https://github.com/ruby/reline/commit/0e30a49d03
2020-12-05 02:58:59 +09:00
aycabta
37a574b527 [ruby/reline] Drop prompt list cache when num of lines is changed
https://github.com/ruby/reline/commit/1959e22043
2020-12-05 02:58:59 +09:00
aycabta
2910684c45 [ruby/reline] Cache dynamic prompt for 0.5sec
https://github.com/ruby/reline/commit/06b89d0e61
2020-12-05 02:58:59 +09:00
aycabta
b763c5cdf0 [ruby/reline] Stop rerendering if the cursor is only moved
https://github.com/ruby/reline/commit/30e8eaf855
2020-12-05 02:58:59 +09:00
aycabta
a297565a4e [ruby/reline] Split #rerender method that is too huge
https://github.com/ruby/reline/commit/d0fbc89253
2020-12-05 02:58:59 +09:00