Commit graph

16449 commits

Author SHA1 Message Date
Nobuyoshi Nakada
069649389c
strip trailing spaces [ci skip] 2021-01-06 17:34:18 +09:00
Takashi Kokubun
d9fdca81ac
600x larger timeout for Reline
I didn't notice it's msec. 2.5s is too short.
http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3311385
2021-01-05 23:02:32 -08:00
Adam Hess
e13f41e02d
[ruby/ostruct] Allow ostruct to return a value on super (#4028)
This fixes cases where you can super in something that inherits from OpenStruct

Co-authored-by: John Hawthorn <john@hawthorn.email>
2021-01-05 18:34:45 -05:00
Nobuyoshi Nakada
ead8d89bd7 [ruby/io-console] Ignore chomp! result and return the modified string
09e5ccc729
2021-01-05 21:26:11 +09:00
aycabta
0123bc9d38 [ruby/irb] Use error tokens if there are no correct tokens in the same place
For example, the broken code "%www" will result in only one error token.

9fa39a7cf3
2021-01-05 18:06:43 +09:00
aycabta
5a1866caff [ruby/irb] Use Ripper::Lexer#scan to take broken tokens
ref. https://github.com/ruby/reline/pull/242

54f90cb6c9
2021-01-05 18:06:34 +09:00
aycabta
505e01fe12 [ruby/irb] Heredoc may contain multiple newlines in a single token
Use the start token as the indentation criteria so that it works properly in
heredoc.

ref. https://github.com/ruby/reline/pull/242

9704808dfd
2021-01-05 18:06:26 +09:00
aycabta
5012512398 [ruby/irb] Handle indentations related to keyword "do" correctly
This fixes ruby/irb#158.

964643400b
2021-01-05 18:06:10 +09:00
aycabta
e72a6ed45f [ruby/irb] Escape invalid byte sequence in Exception
This fixes ruby/irb#141.

0815317d42
2021-01-05 18:05:06 +09:00
aycabta
cce72a2411 [ruby/irb] Newline in oneliner def doesn't reset indent
This closes ruby/irb#132.

43456dcf5e
2021-01-05 18:04:45 +09:00
aycabta
515d6b47ad [ruby/irb] Stringify when a non-object is passed to PP#text
If a nested object is passed to #pp, it may be sometimes passed to the #text
method as an object without being stringified.

This is fixed on the Ruby main repository;
433a3be86a
but it was a bug of Ripper so still needs this workaround for using irb
as a gem on Ruby 3.0.0 or earlier.

Co-authored-by: k0kubun <takashikkbn@gmail.com>

8d13df22ee
2021-01-04 20:14:31 -08:00
Takashi Kokubun
7a3322a0fd
Fix broken JIT of getinlinecache
e7fc353f04 reverted vm_ic_hit_p's signature change made in 53babf35ef,
which broke JIT compilation of getinlinecache.

To make sure it doesn't happen again, I separated vm_inlined_ic_hit_p to
make the intention clear.
2021-01-04 13:09:08 -08:00
Koichi Sasada
e7fc353f04 enable constant cache on ractors
constant cache `IC` is accessed by non-atomic manner and there are
thread-safety issues, so Ruby 3.0 disables to use const cache on
non-main ractors.

This patch enables it by introducing `imemo_constcache` and allocates
it by every re-fill of const cache like `imemo_callcache`.
[Bug #17510]

Now `IC` only has one entry `IC::entry` and it points to
`iseq_inline_constant_cache_entry`, managed by T_IMEMO object.

`IC` is atomic data structure so `rb_mjit_before_vm_ic_update()` and
`rb_mjit_after_vm_ic_update()` is not needed.
2021-01-05 02:27:58 +09:00
Hiroshi SHIBATA
5537adf719 Track RubyGems master(3.3.0.dev) branch at 55634a8af18a52df86c4275d70fa1179118bcc20 2021-01-04 13:14:43 +09:00
Nobuyoshi Nakada
35c3a24c8c
Fixed error message when % at EOF 2021-01-04 12:11:37 +09:00
Nobuyoshi Nakada
f4be7a510e
Added tests for Time#getlocal with UTC offset 2021-01-03 23:56:04 +09:00
Takashi Kokubun
4724bf856f
Avoid hanging on --jit-wait after MJIT.pause
When a worker is stopped, nobody will JIT a method for you.
2021-01-03 00:05:38 -08:00
zverok
b8d33df1d9 Add Enumerable#compact and Enumerator::Lazy#compact 2021-01-02 17:27:24 +09:00
Kenta Murata
c2c0147538
[ruby/bigdecimal] Fix test for Ruby 2.4
Ruby 2.4 does not have RbConfig::LIMITS.

c8087523b0
2021-01-02 00:54:09 +09:00
Kenta Murata
448a67cd81
[ruby/bigdecimal] Implement special conversions for 64-bit integers
This change improves the conversion speed from small integers.

```
Comparison:
                           big_n9
              master:   4003688.9 i/s
    bigdecimal 3.0.0:   1270551.0 i/s - 3.15x  slower

                          big_n19
              master:   5410096.4 i/s
    bigdecimal 3.0.0:   1000250.3 i/s - 5.41x  slower
```

3429bd7e6f
2021-01-02 00:54:09 +09:00
Kenta Murata
5ee6830abe [ruby/bigdecimal] Fix test_limit
Keep the default value of BigDecimal.limit by BigDecimal.save_limit
to avoid failures of the other test methods due to the unexpected limit.

bdc1cc6585
2021-01-02 00:30:57 +09:00
Nobuyoshi Nakada
ab32e98f98
Added AST assertions for method definition arguments [Bug #17495] 2021-01-01 14:48:46 +09:00
Nobuyoshi Nakada
1e51027763
Added AST tests for endless method definitions 2021-01-01 14:45:00 +09:00
Nobuyoshi Nakada
20a8425aa0
Make any hash values fixable [Bug #17488]
As hnum is an unsigned st_index_t, the result of RSHIFT may not be
in the fixable range.

Co-authored-by: NeoCat <neocat@neocat.jp>
2020-12-31 12:11:45 +09:00
Takashi Kokubun
15c129d087
Try increasing SMTP's read_timeout for --jit-wait
for random hangs like:
http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3302796
http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3302188
http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3301293
2020-12-29 22:02:48 -08:00
Takashi Kokubun
8e231ffa8c
Increase timeout for reline with --jit-wait
for failures like:
http://ci.rvm.jp/logfiles/brlog.trunk-mjit-wait.20201229-130509
http://ci.rvm.jp/logfiles/brlog.trunk-mjit-wait.20201229-165132
http://ci.rvm.jp/logfiles/brlog.trunk-mjit-wait.20201228-015519
2020-12-29 20:06:53 -08:00
Nobuhiro IMAI
9b7ceb6765
irb: add more syntax errors colorizing support (#3967) 2020-12-28 23:07:20 -08:00
Takashi Kokubun
af9d4ee133 [ruby/irb] Fix failing tests
7723ade899
2020-12-28 23:01:01 -08:00
Nobuyoshi Nakada
c8010fcec0
Dup kwrest hash when merging other keyword arguments [Bug #17481] 2020-12-28 01:52:18 +09:00
Nobuyoshi Nakada
92f9f998fb
test/test_trick.rb: fixed the position to add timeout 2020-12-25 22:23:53 +09:00
Yusuke Endoh
a01d28fed7 test/test_trick.rb: increase timeout of some tests
20201225T071824Z.fail.html.gz
2020-12-25 21:58:50 +09:00
Nobuyoshi Nakada
caae14d90b
test_trick.rb: Make the encoding explicit for code written in UTF-8 2020-12-25 15:57:41 +09:00
Yusuke Endoh
09216f63ba
test/test_trick.rb: Add a test file for TRICK entries (#3988)
* test/test_trick.rb: Add a test file for TRICK entries

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2020-12-25 15:22:37 +09:00
aycabta
9a7647d9eb [ruby/reline] Doesn't contain terminate spaces by cw
This closes ruby/reline#233.

4c3f2e2eae
2020-12-24 23:26:22 +09:00
aycabta
78421319d0 [ruby/reline] Use #bytesize for vi_replace_char
This closes ruby/reline#228.

8205fa0b00
2020-12-24 23:26:22 +09:00
aycabta
0db9842b2c [ruby/reline] Delete the last char of a line by dw
This closes ruby/reline#229.

3f0ae689c4
2020-12-24 23:26:22 +09:00
aycabta
634b231f33 [ruby/reline] Discard prompt cache by changing mode icon
bfeda8a79b
2020-12-24 23:26:22 +09:00
Nobuyoshi Nakada
bdbbfd1fa5 Store errno in struct rb_process_status
To propagate errno in the fiber thread scheduler hook.
Returns nil when no terminated process.
2020-12-24 22:59:37 +09:00
Marc-Andre Lafortune
7ca2ca9e32 Remove unneeded code 2020-12-24 04:58:40 -05:00
Yusuke Endoh
8e1c0b2f93 dir.c: chdir conflict should raise only when called in different thread
... and keep it as a warning (like 2.7) when it is called in the same
thread. [Bug #15661]
2020-12-24 14:34:40 +09:00
Koichi Sasada
6f29716f9f shareable_constant_value: experimental_copy
"experimental_everything" makes the assigned value, it means
the assignment change the state of assigned value.
"experimental_copy" tries to make a deep copy and make copyied object
sharable.
2020-12-24 14:28:47 +09:00
Jeremy Evans
1e215a66d2 Fix class of method in Method#inspect for singleton classes of classes
Previously, due to a change to fix bug 15608, Method#inspect output
changed for class methods:

Ruby 2.7
"#<Method: String.prepend(*)>"

Before change:
"#<Method: #<Class:Object>(Module)#prepend(*)>"

This is wrong because the Method object was created from String and
not Object. This is because the fix for bug 15608 assumed it was
being called on the singleton class of a instance, and would skip
the first singleton class until it got to the class itself.  For
class methods, this results in always using the superclass. Fix
behavior to not skip until the superclass if the singleton class
is the singleton class of a module or class.

After change:
"#<Method: #<Class:Object>(Module)#prepend(*)>"

Fixes [Bug #17428]
2020-12-23 19:29:19 -08:00
Yusuke Endoh
f755926ddd test/ruby/test_module.rb: not depend on the order of method definitions 2020-12-24 10:15:15 +09:00
Nobuyoshi Nakada
4a8ff22f0c
Reset paren_nest at tAREF and tASET [Bug #17431] 2020-12-24 01:39:52 +09:00
Yusuke Endoh
3a81daaf8d Module#public_class_method also accepts a symbol array as an argument
I'm unsure if this is intentional, but add a document anyway.
[Feature #17314]
2020-12-24 00:15:29 +09:00
aycabta
129ecb43e5 [ruby/irb] Fix error_message for assert_dynamic_prompt
b12dfb6298
2020-12-23 21:26:25 +09:00
Hiroshi SHIBATA
8259d88938 [ruby/psych] Skip test_ractor.rb with ruby/psych repo
Because ruby/psych still uses minitest. minitest didn't support
  assert_ractor provided by test suite of ruby/ruby repo.

7da26358f1
2020-12-23 19:45:54 +09:00
Marc-Andre Lafortune
daec109f42 [ruby/psych] Optimize cache with compare_by_identity
Using `compare_by_identity` gives a 4x performance boost on cache hits.
Benchmark in https://github.com/JuanitoFatas/fast-ruby/issues/189
2020-12-23 01:08:38 -05:00
Marc-Andre Lafortune
c5a445d577 [ruby/psych] Make Ractor-ready.
Config is Ractor-local.

Benchmarking reveals that using `Ractor.local_storage` for storing cache
is similar to accessing a constant (~15% slower).
2020-12-23 01:08:38 -05:00
Nobuyoshi Nakada
8a1e12499b Ensure non-literal expressions shareable if leteral 2020-12-23 13:50:42 +09:00