summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-10-25* 2020-10-25 [ci skip]git
2020-10-25Try to fix compilation on MSVCBenoit Daloze
2020-10-24Update to ruby/spec@4f59d86Benoit Daloze
2020-10-24Update to ruby/mspec@b56e7a2Benoit Daloze
2020-10-24* 2020-10-24 [ci skip]git
2020-10-24Tweaks for the ruby/spec workflowBenoit Daloze
2020-10-23numeric.c, range.c: prohibit zero stepKenta Murata
* numeric.c: prohibit zero step in Numeric#step * range.c: prohibit zero step in Range#step * Fix ruby-spec [Feature #15573] Notes: Merged: https://github.com/ruby/ruby/pull/3689 Merged-By: mrkn <mrkn@ruby-lang.org>
2020-10-22Assert in_gc >= 0 instead of guarding it (#3687)Takashi Kokubun
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2020-10-23.github/workflows/spec_guards.yml add卜部昌平
Translate a part of .travis.yml into GitHub Actions workflow. Notes: Merged: https://github.com/ruby/ruby/pull/3685
2020-10-22mutete -> mutateAlan Wu
2020-10-22Fix small typo in comment in lib/irb.cAndrew Kerr
Notes: Merged: https://github.com/ruby/ruby/pull/3688
2020-10-23* 2020-10-23 [ci skip]git
2020-10-22Revert "Add assertions when inline caches are copied to MJIT"Aaron Patterson
This reverts commit 6cb6d5abc36ede9d5158c2cd90734134838e6bfb. This reverts commit 1484b786aee8d411a9e2278ac6d6e44aedbf6662. I think we don't need these assertions anymore. I believe the problem is solved by abf678a4397c6c00a1bb686043e377d372e695a4
2020-10-22Use a lock level for a less granular lock.Aaron Patterson
We are seeing an error where code that is generated with MJIT contains references to objects that have been moved. I believe this is due to a race condition in the compaction function. `gc_compact` has two steps: 1. Run a full GC to pin objects 2. Compact / update references Step one is executed with `garbage_collect`. `garbage_collect` calls `gc_enter` / `gc_exit`, these functions acquire a JIT lock and release a JIT lock. So a lock is held for the duration of step 1. Step two is executed by `gc_compact_after_gc`. It also holds a JIT lock. I believe the problem is that the JIT is free to execute between step 1 and step 2. It copies call cache values, but doesn't pin them when it copies them. So the compactor thinks it's OK to move the call cache even though it is not safe. We need to hold a lock for the duration of `garbage_collect` *and* `gc_compact_after_gc`. This patch introduces a lock level which increments and decrements. The compaction function can increment and decrement the lock level and prevent MJIT from executing during both steps. Notes: Merged: https://github.com/ruby/ruby/pull/3683
2020-10-22rational.c: try converting by to_int in Rational() (#3684)Kenta Murata
[Bug #12485] Notes: Merged-By: mrkn <mrkn@ruby-lang.org>
2020-10-22refactoring obj_traverse_iKoichi Sasada
2020-10-22allow to access ivars of frozen shareable objectsKoichi Sasada
Accessing a shareable object is prohibitted because it can cause race condition, but if the shareable object is frozen, there is no problem to access ivars.
2020-10-22* 2020-10-22 [ci skip]git
2020-10-21refactoring frozen_shareable_pKoichi Sasada
2020-10-21refactoring rb_obj_traverse()Koichi Sasada
* create rec check hash lazily * do not pass *data pointer for enter/leave function because it is not used. Notes: Merged: https://github.com/ruby/ruby/pull/3682
2020-10-21refactoring rb_ractor_confirm_belonging()Koichi Sasada
rb_ractor_belonging() returns 0 only if it has sharable flag. rb_ractor_confirm_belonging() checks rb_ractor_shareable_p() if the belonging ractor id is different from current ractor id. Notes: Merged: https://github.com/ruby/ruby/pull/3682
2020-10-21check main-ractor or not firstKoichi Sasada
On non-multi-ractor-mode, the cost of rb_ractor_main_p() is low so check it first. Notes: Merged: https://github.com/ruby/ruby/pull/3682
2020-10-21test/json/json_parser_test.rb: suppress warningsYusuke Endoh
http://rubyci.s3.amazonaws.com/ubuntu/ruby-master/log/20201021T123003Z.log.html.gz ``` /home/chkbuild/chkbuild/tmp/build/20201021T123003Z/ruby/test/json/json_parser_test.rb:227: warning: ambiguous first argument; put parentheses or a space even after `-' operator /home/chkbuild/chkbuild/tmp/build/20201021T123003Z/ruby/test/json/json_parser_test.rb:228: warning: ambiguous first argument; put parentheses or a space even after `-' operator ```
2020-10-21extend timeout of rbs test on rbs testsKoichi Sasada
2020-10-21Ractor-safe rb_objspace_reachable_objects_fromKoichi Sasada
rb_objspace_reachable_objects_from(obj) is used to traverse all reachable objects from obj. This function modify objspace but it is not ractor-safe (thread-safe). This patch fix the problem. Strategy: (1) call GC mark process during_gc (2) call Ractor-local custom mark func when !during_gc Notes: Merged: https://github.com/ruby/ruby/pull/3680
2020-10-21Removed more unnecessary ID cachesNobuyoshi Nakada
``` find . -name \*.o -exec nm {} + |& grep -e 'InitVM_.*\.rbimpl_id' -e 'Init_.*\.rbimpl_id' | sed 's/^.* b //;s/\.[1-9][0-9]*$//;s/\.rbimpl_id$//' | uniq ``` should be empty.
2020-10-21Use rb_intern_const instead of rb_intern in Init functionsNobuyoshi Nakada
``` find . -name \*.o -exec nm {} + |& sed '/Init_.*\.rbimpl_id/!d;s/^.* b //;s/\.[1-9][0-9]*$//;s/\.rbimpl_id$//' | uniq ``` should be empty.
2020-10-21Don't redefine #rb_intern over and over againStefan Stüben
Notes: Merged: https://github.com/ruby/ruby/pull/3589
2020-10-21Update dependencies for macOSNobuyoshi Nakada
2020-10-21Check dependencies on macOS tooNobuyoshi Nakada
2020-10-21Calculate transient heap block usable size at compile timeJacob Matthews
Notes: Merged: https://github.com/ruby/ruby/pull/3632
2020-10-21.github: reduce copy&paste卜部昌平
Found that we can set default working directory for github actions. Notes: Merged: https://github.com/ruby/ruby/pull/3675
2020-10-21.travis.yml: reduce redundant tests卜部昌平
These tests are (more or less) covered by github actions now. Notes: Merged: https://github.com/ruby/ruby/pull/3675
2020-10-21Ractor.make_shareable(obj)Koichi Sasada
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. Notes: Merged: https://github.com/ruby/ruby/pull/3678
2020-10-21* 2020-10-21 [ci skip]git
2020-10-21Feature #16812: Allow slicing arrays with ArithmeticSequence (#3241)Kenta Murata
* Support ArithmeticSequence in Array#slice * Extract rb_range_component_beg_len * Use rb_range_values to check Range object * Fix ary_make_partial_step * Fix for negative step cases * range.c: Describe the role of err argument in rb_range_component_beg_len * Raise a RangeError when an arithmetic sequence refers the outside of an array [Feature #16812] Notes: Merged-By: mrkn <mrkn@ruby-lang.org>
2020-10-20Dump FrozenCore speciallyNobuyoshi Nakada
2020-10-20strip trailing spaces [ci skip]Nobuyoshi Nakada
2020-10-20fix conditionKoichi Sasada
2020-10-20NEWS.md: mention TypeProfYusuke Endoh
Notes: Merged: https://github.com/ruby/ruby/pull/3674
2020-10-20Fix an issue with generate_pretty and empty objects in the Ruby and Java ↵Chris Seaton
implementations
2020-10-20Implement a freeze: parser optionJean Boussier
If set to true all parsed objects will be immediately frozen, and strings will be deduplicated if the Ruby implementation allows it.
2020-10-20Added rbs and typeprof to doc/*Hiroshi SHIBATA
2020-10-20skip `echo foo` on SolarisKoichi Sasada
On Solaris, it seems to access ENV in ``, so skip it now. ``` stderr output is not empty Exception `NameError' at bootstraptest.tmp.rb:7 - can not access non-sharable objects in constant Object::ENV by non-main Ractor. #<Thread:0x0044cdf0 run> terminated with exception (report_on_exception is true): bootstraptest.tmp.rb:7:in ``': can not access non-sharable objects in constant Object::ENV by non-main Ractor. (NameError) Exception `Ractor::RemoteError' at <internal:ractor>:130 - thrown by remote Ractor. <internal:ractor>:130:in `take': thrown by remote Ractor. (Ractor::RemoteError) from bootstraptest.tmp.rb:55:in `<main>' bootstraptest.tmp.rb:7:in ``': can not access non-sharable objects in constant Object::ENV by non-main Ractor. (NameError) from bootstraptest.tmp.rb:7:in `ractor_local_globals' from bootstraptest.tmp.rb:54:in `block in <main>' ```
2020-10-20range.c: Fix an exception message in rb_range_beg_lenKenta Murata
[Bug #17271]
2020-10-20ObjectSpace.each_object with RactorsKoichi Sasada
Unshareable objects should not be touched from multiple ractors so ObjectSpace.each_object should be restricted. On multi-ractor mode, ObjectSpace.each_object only iterates shareable objects. [Feature #17270] Notes: Merged: https://github.com/ruby/ruby/pull/3672
2020-10-20add Ractor.shareable?(obj)Koichi Sasada
This method returns obj is shareable or not. Notes: Merged: https://github.com/ruby/ruby/pull/3672
2020-10-20Some global variables can be accessed from ractorsKoichi Sasada
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, ``` Notes: Merged: https://github.com/ruby/ruby/pull/3670
2020-10-20add a NEWS for Fiber#transferKoichi Sasada
2020-10-20Bundle typeprof gem as bundled gemsYusuke Endoh
Notes: Merged: https://github.com/ruby/ruby/pull/3668