Commit graph

64552 commits

Author SHA1 Message Date
Nobuyoshi Nakada
acdb893338
Removed unused environment variable 2020-10-27 14:42:24 +09:00
Nobuyoshi Nakada
135d369096
[DOC] more precise description of "**" in Dir.glob pattern [ci skip] 2020-10-27 08:55:10 +09:00
Alan Wu
c56fdaecc4 Revert assert for debugging on CI
This reverts commit ac69849e49.
The bug seems to have been fixed.
2020-10-26 16:44:15 -04:00
Koichi Sasada
7ad56fd87b freeze dynamic regexp literals
Regexp literals are frozen, and also dynamically comppiled Regexp
literals (/#{expr}/) are frozen.
2020-10-27 01:45:57 +09:00
git
f8d264fdfd * 2020-10-27 [ci skip] 2020-10-27 01:37:49 +09:00
Koichi Sasada
1c6ebe14fb freeze Process::Status
It seems immutable information.
2020-10-27 01:37:24 +09:00
Nobuyoshi Nakada
bdd1d17ac2
Allow non-argument endless-def with a space instead of parentheses 2020-10-26 21:15:16 +09:00
Kenta Murata
69837229d7
rational.c: convert a numerator to rational before calling fdiv in Kernel.Rational() (#3702)
This makes `Rational(BigDecimal(1), 60) == Rational(1, 60)`.
[Bug #16518]
2020-10-26 18:43:30 +09:00
Nobuyoshi Nakada
52c630da00
Assoc pattern matching (#3703)
[Feature #17260] One-line pattern matching using tASSOC

R-assignment is rejected instead.
2020-10-26 18:00:24 +09:00
Benoit Daloze
cffdacb15a Ignore <internal: entries from core library methods for Kernel#warn(message, uplevel: n)
* Fixes [Bug #17259]
2020-10-26 08:47:33 +01:00
Benoit Daloze
fbb2d30ee6 Add specs that #caller and #caller_locations include core library methods defined in Ruby 2020-10-26 08:47:33 +01:00
Benoit Daloze
3673c3eafc Update to ruby/spec@b164536 2020-10-26 08:20:48 +01:00
Benoit Daloze
ba24aee292 Remove spec which is too difficult to get working with various compilers
* The spec means to use an actual system library function, not a wrapper.
2020-10-26 08:06:33 +01:00
Nobuyoshi Nakada
507af75415
[DOC] Expanded glob patterns for Dir.glob
No longer need to get rid of C block comments in builtin ruby
script comments.
2020-10-26 09:09:45 +09: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
Nobuyoshi Nakada
396e921044
Escape '/*' within block comment too 2020-10-26 09:01:27 +09:00
Nobuyoshi Nakada
b6d0b3dfaf
Use gcc-specific pragma only on gcc (and the family) 2020-10-26 08:16:51 +09:00
Jeremy Evans
ff2276ef8c Fix bootstrap-test error in previous commit 2020-10-25 15:56:10 -07:00
Marc-Andre Lafortune
9c8f0a34df Use 'shareable' with an 'e' [ci skip] 2020-10-25 18:10:14 -04:00
git
8376cae25a * 2020-10-26 [ci skip] 2020-10-26 05:45:34 +09:00
Marc-Andre Lafortune
5e6f9fd83a Tweak a few Ractor tests that were missing comments [ci skip] 2020-10-25 16:44:59 -04:00
Marc-Andre Lafortune
ee54075a94 Remove trailing whitespace [ci skip] 2020-10-25 16:38:37 -04:00
Nobuyoshi Nakada
25a332f5cf
Fix compilation on MSVC
* cast scalar value instead of function
* use `rb_pid_t` for the portability
2020-10-25 22:07:09 +09:00
Nobuyoshi Nakada
e880d075f8
[DOC] refined "**" description in Dir.glob [ci skip]
As same as the description for `File.fnmatch`.
[Bug #17283]
2020-10-25 21:24:23 +09:00
git
8d22dd8cb8 * 2020-10-25 [ci skip] 2020-10-25 19:43:43 +09:00
Benoit Daloze
99e067eac6 Try to fix compilation on MSVC 2020-10-25 11:42:20 +01:00
Benoit Daloze
148961adcd Update to ruby/spec@4f59d86 2020-10-24 15:53:53 +02:00
Benoit Daloze
342fbae83c Update to ruby/mspec@b56e7a2 2020-10-24 15:53:53 +02:00
git
1388257d7a * 2020-10-24 [ci skip] 2020-10-24 22:52:20 +09:00
Benoit Daloze
71f699543b Tweaks for the ruby/spec workflow 2020-10-24 15:51:18 +02:00
Kenta Murata
f754b42285
numeric.c, range.c: prohibit zero step
* numeric.c: prohibit zero step in Numeric#step

* range.c: prohibit zero step in Range#step

* Fix ruby-spec

[Feature #15573]
2020-10-23 15:26:51 +09:00
Takashi Kokubun
40bad72f31
Assert in_gc >= 0 instead of guarding it (#3687) 2020-10-22 21:59:13 -07:00
卜部昌平
7cf34cfaa3 .github/workflows/spec_guards.yml add
Translate a part of .travis.yml into GitHub Actions workflow.
2020-10-23 10:38:34 +09:00
Alan Wu
196eada8c6 mutete -> mutate 2020-10-22 18:20:35 -04:00
Andrew Kerr
ef3c25888e Fix small typo in comment in lib/irb.c 2020-10-22 10:56:35 -07:00
git
b9193df971 * 2020-10-23 [ci skip] 2020-10-23 01:52:32 +09:00
Aaron Patterson
9a6720a15d
Revert "Add assertions when inline caches are copied to MJIT"
This reverts commit 6cb6d5abc3.
This reverts commit 1484b786ae.

I think we don't need these assertions anymore.  I believe the problem
is solved by abf678a439
2020-10-22 09:52:05 -07:00
Aaron Patterson
abf678a439 Use a lock level for a less granular lock.
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.
2020-10-22 07:59:06 -07:00
Kenta Murata
d23d5c3130
rational.c: try converting by to_int in Rational() (#3684)
[Bug #12485]
2020-10-22 17:59:52 +09:00
Koichi Sasada
603fb940c0 refactoring obj_traverse_i 2020-10-22 00:43:44 +09:00
Koichi Sasada
0c0d0752f1 allow to access ivars of frozen shareable objects
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 00:43:44 +09:00
git
9629378477 * 2020-10-22 [ci skip] 2020-10-22 00:07:02 +09:00
Koichi Sasada
3a97d36157 refactoring frozen_shareable_p 2020-10-21 23:57:44 +09:00
Koichi Sasada
89f6644de7 refactoring rb_obj_traverse()
* create rec check hash lazily
* do not pass *data pointer for enter/leave function because
  it is not used.
2020-10-21 23:52:11 +09:00
Koichi Sasada
af2471365f refactoring rb_ractor_confirm_belonging()
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.
2020-10-21 23:52:11 +09:00
Koichi Sasada
631eaa8510 check main-ractor or not first
On non-multi-ractor-mode, the cost of rb_ractor_main_p() is low
so check it first.
2020-10-21 23:52:11 +09:00
Yusuke Endoh
762be87759 test/json/json_parser_test.rb: suppress warnings
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-21 23:37:42 +09:00
Koichi Sasada
4414031735 extend timeout of rbs test on rbs tests 2020-10-21 17:59:03 +09:00
Koichi Sasada
b59077eecf Ractor-safe rb_objspace_reachable_objects_from
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
2020-10-21 16:15:22 +09:00
Nobuyoshi Nakada
4640c4ea8a
Removed more unnecessary ID caches
```
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-21 13:04:20 +09:00