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

64535 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada c7a5cc2c30
Replaced magic numbers tr table 2020-12-21 23:45:38 +09:00
Naohisa Goto 84eebb3c9e On Solaris, _XOPEN_SOURCE should be undefined for C++ sources. 2020-12-21 23:42:34 +09:00
Koichi Sasada 91e2f08a6a export rb_eRactorIsolationError for MJIT
https://ci.appveyor.com/project/ruby/ruby/builds/36942168/job/7ugrpk0pndoly9wp
```
_ruby_mjit_p11920u0.c
C:\Users\appveyor\AppData\Local\Temp\1/_ruby_mjit_p11920u0.c(14) : warning C4005: 'GET_SELF' : macro redefinition
        c:\projects\ruby\vm_insnhelper.h(111) : see previous definition of 'GET_SELF'
   Creating library C:\Users\appveyor\AppData\Local\Temp\1/_ruby_mjit_p11920u0.lib and object C:\Users\appveyor\AppData\Local\Temp\1/_ruby_mjit_p11920u0.exp
_ruby_mjit_p11920u0.obj : error LNK2001: unresolved external symbol rb_eRactorIsolationError
C:\Users\appveyor\AppData\Local\Temp\1/_ruby_mjit_p11920u0.so : fatal error LNK1120: 1 unresolved externals
```
2020-12-21 23:28:05 +09:00
Kenta Murata 0b6a80c0be
[json] Avoid method redefinition 2020-12-21 22:41:24 +09:00
Koichi Sasada dca6752fec Introduce Ractor::IsolationError
Ractor has several restrictions to keep each ractor being isolated
and some operation such as `CONST="foo"` in non-main ractor raises
an exception. This kind of operation raises an error but there is
confusion (some code raises RuntimeError and some code raises
NameError).

To make clear we introduce Ractor::IsolationError which is raised
when the isolation between ractors is violated.
2020-12-21 22:29:05 +09:00
Kenta Murata 8c0c61728f
NEWS: JSON is Ractor compatible [ci skip] 2020-12-21 22:16:02 +09:00
Kenta Murata 14d7d1df25
[json] Make json Ractor safe 2020-12-21 22:10:43 +09:00
Kenta Murata 4c2e7f26bd
[json] JSON_parse_float: Fix how to convert number
Stop BigDecimal-specific optimization.  Instead, it tries the conversion
methods in the following order:

1. `try_convert`,
2. `new`, and
3. class-named function, e.g. `Foo::Bar.Baz` function for `Foo::Bar::Baz` class

If all the above candidates are unavailable, it fallbacks to Float.
2020-12-21 22:10:43 +09:00
Kenta Murata 596da98b3f
[json] Make JSON.create_id thread-safe 2020-12-21 22:10:42 +09:00
Kenta Murata 98cc15ed1e
[json] Stop using prototype objects 2020-12-21 22:10:33 +09:00
Nobuyoshi Nakada d84dd66da0
Fixed a typo in an error class name 2020-12-21 18:17:45 +09:00
Nobuyoshi Nakada b9d00f42e6
Enable escape sequence on Windows10 console via pager too 2020-12-21 18:12:02 +09:00
Kenta Murata d8469507b9
[ruby/digest] Remove .gitignore and .travis.yml from gemspec
https://github.com/ruby/digest/commit/7b57b73f46
2020-12-21 17:46:30 +09:00
U.Nakamura 09f939d3a0 Enable escape sequence on Windows10 console
* win32/win32.c (init_stdhandle): enable escape sequence on
	  Windows10 console to show `ruby --help` colors correctly.
2020-12-21 17:29:09 +09:00
Hiroshi SHIBATA 95ce5c0ee9 [ruby/rdoc] Bump version to 6.3.0
https://github.com/ruby/rdoc/commit/3d3616cb94
2020-12-21 16:22:08 +09:00
Hiroshi SHIBATA 391343e828 [ruby/rdoc] Guard for WEBrick
https://github.com/ruby/rdoc/commit/b1e7129e05
2020-12-21 16:21:46 +09:00
Takashi Kokubun f26f905b28
Mark an ISeq being JIT-ed
This is to avoid SEGV on a CC reference in a normal compilation
https://github.com/ruby/ruby/runs/1586578023
2020-12-20 23:17:37 -08:00
Takashi Kokubun 1fdc97f1b7
Mark active_units
to avoid SEGV on mjit_recompile and compact_all_jit_code.

For some reason, ISeqs on stack are sometimes GC-ed (why?) and therefore
it may run mjit_recompile on a GC-ed ISeq, which I expected d07183ec85
to fix but apparently it may refer to random things if already GC-ed.
Marking active_units would workaround the situation.
http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3292740

Also, while compact_all_jit_code was executed, we saw some SEGVs where
CCs seemed to be already GC-ed, meaning their owner ISeq was not marked
properly. Even if units are still in active_units, it's not guaranteed
that their ISeqs are in use. So in this case we need to mark active_units
for a legitimate reason.
http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3293277
http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3293090
2020-12-20 22:58:45 -08:00
Takashi Kokubun a574df14e4
Stop marking unit_queue
The original motivation of this marking was https://github.com/k0kubun/yarv-mjit/issues/20.
As wanabe said, there are multiple options to mitigate the issue, and
Eric Wong introduced another fix at 143776f6fe by checking unit->iseq
inside the lock.

Therefore this particular condition has been covered in two ways, and
the script given by wanabe no longer crashes without mjit_mark().
2020-12-20 22:03:20 -08:00
Kazuhiro NISHIYAMA 74a7877836
[DOC] Remove about FrozenError from Ractor::MovedObject [ci skip]
Because unfreeze Ractor::MovedObject at
76e8848037
2020-12-21 13:25:03 +09:00
Marc-Andre Lafortune 1ecac8e4d0 Add `require_relative` option to `assert_ractor` 2020-12-20 22:00:05 -05:00
Yusuke Endoh eee93bc933 eval_error.c: fix off-by-one error for --backtrace-limit
https://bugs.ruby-lang.org/issues/17413
2020-12-21 11:40:48 +09:00
Hiroshi SHIBATA ac78d90d5e
Bump bundled rake version to 13.0.3 2020-12-21 11:23:01 +09:00
卜部昌平 fe60480947 include/ruby/internal/xmalloc.h: document rb_eNoMemError
It was my bad, the exception that actually raises is rb_eNoMemError.
[ci skip]
2020-12-21 11:01:01 +09:00
卜部昌平 11656d15e2 include/ruby/internal/xmalloc.h: doxygen tag
`@exception` is an alias of `@throw`.  It might suite Ruby's document
because ruby uses `raise` terminology instead of `throw`. [ci skip]
2020-12-21 11:01:01 +09:00
Kazuhiro NISHIYAMA 63849a1cd9
Fix misspellings [ci skip] 2020-12-21 10:54:24 +09:00
Victor Shepelev 5253b9579a
Document usage of ArithmeticSequence in Array#slice, and add to NEWS (#3952) 2020-12-21 09:32:30 +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
Ivan Denysov 435b619a3d fix phrasing in comment 2020-12-20 12:38:11 -05:00
Koichi Sasada 7600f69a8e rename to rb_ractor_make_shareable_copy()
from rb_ractor_make_copy_shareable().
2020-12-21 02:21:33 +09:00
Nobuyoshi Nakada 9c73c75624
Use Integer instead of Fixnum/Bignum 2020-12-21 01:19:55 +09:00
Nobuyoshi Nakada fb8f011422
Fixed indefinite articles before "Integer" [ci skip] 2020-12-21 01:19:55 +09:00
Nobuyoshi Nakada ad534a677a
Fixnum as a Symbol was an old feature until 1.6 2020-12-21 01:19:55 +09:00
git a365ae841b * 2020-12-21 [ci skip] 2020-12-21 01:15:45 +09:00
Koichi Sasada 730f314171 fix Ractor.make_shareable() with Class/Module
To check shareable-ness, rb_ractor_shareable_p() is needed
for Class/Module objects isntead of checking flags.
2020-12-21 01:13:39 +09:00
Nobuyoshi Nakada 8680ae9cbd
irb: Removed unused variables 2020-12-20 19:36:24 +09:00
Nobuyoshi Nakada 4b6e3f7b82
irb: Define extension command on the given object 2020-12-20 19:35:59 +09:00
Nobuyoshi Nakada 37987d9994 win32: Deprecate file CP version functions 2020-12-20 18:34:04 +09:00
Nobuyoshi Nakada 95862ae440 win32: Added rb_w32_ureaddir only for UTF-8 [Feature #12654] 2020-12-20 18:34:04 +09:00
Nobuyoshi Nakada 5b98b2ce39 win32: Use UTF-8 as filesystem encoding [Feature #12654]
Co-Authored-By: Dāvis Mosāns <davispuh@gmail.com>
2020-12-20 18:34:04 +09:00
Nobuyoshi Nakada feea436feb
irb: Define extension command only on the given object
Not to interfer in class variables.
2020-12-20 18:26:38 +09:00
Nobuyoshi Nakada 0fad9a9e30
Set non-verbose mode as well as tty mode 2020-12-20 17:15:02 +09:00
aycabta 59b84fbf2e Set :DEFAULT to PROMPT_MODE for CI 2020-12-20 17:07:24 +09:00
aycabta 216a087e93 Suppress errors related to using variables that are not directly related to testing 2020-12-20 16:48:47 +09:00
aycabta 24fcbc92b4 [ruby/irb] Version 1.2.8
https://github.com/ruby/irb/commit/bcd96834c7
2020-12-20 16:23:59 +09:00
aycabta a7cacd33cc [ruby/reline] Version 0.1.10
https://github.com/ruby/reline/commit/723c6e191a
2020-12-20 16:23:59 +09:00
aycabta 9f08e3c703 [ruby/irb] Add measure command
You can use "measure" command to check performance in IRB like below:

  irb(main):001:0> 3
  => 3
  irb(main):002:0> measure
  TIME is added.
  => nil
  irb(main):003:0> 3
  processing time: 0.000058s
  => 3
  irb(main):004:0> measure :off
  => nil
  irb(main):005:0> 3
  => 3

You can set "measure :on" by "IRB.conf[:MEASURE] = true" in .irbrc, and, also,
set custom performance check method:

  IRB.conf[:MEASURE_PROC][:CUSTOM] = proc { |context, code, line_no, &block|
    time = Time.now
    result = block.()
    now = Time.now
    puts 'custom processing time: %fs' % (Time.now - time) if IRB.conf[:MEASURE]
    result
  }

https://github.com/ruby/irb/commit/3899eaf2e2
2020-12-20 16:23:59 +09:00
aycabta 8b6aaeaddf [ruby/irb] Handle rest of tokens correctly if no newline at last
https://github.com/ruby/irb/commit/f3c8edad2a
2020-12-20 16:23:58 +09:00
Kazuki Tsujimoto 67ee1cbdd5
Remove unnecessary files from .document
* ruby:ext/rbconfig/exts.mk
* ruby:ext/rbconfig/sizeof/Makefile
* ruby:ext/rbconfig/sizeof/depend
* ruby:ext/rbconfig/sizeof/mkmf.log
* ruby:ext/win32/depend
* ruby:ext/win32/exts.mk
* ruby:ext/win32/resolv/depend
* ruby:lib/racc/pre-setup
2020-12-20 16:00:13 +09:00
Nobuyoshi Nakada b911509a08
Adjusted indents of closing braces [ci skip] 2020-12-20 15:13:25 +09:00