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

74412 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada 230267d1a8 Now bison 3.0 or later is required 2022-11-09 21:34:02 +09:00
Yusuke Endoh c3de7a3c58 Make pending_interrupt?(Exception) work
A patch from katsu (Katsuhiro Ueno)

[Bug #19110]
2022-11-09 12:25:35 +09:00
Nobuyoshi Nakada 558137d5f3
[DOC] Fix missing type name 2022-11-09 12:04:22 +09:00
Nobuyoshi Nakada ef1c1ddf68
Use `rb_sprintf` instead of deprecated `sprintf` 2022-11-09 11:58:37 +09:00
Alan Wu 5d95cd99f4 YJIT: Reset dropped_bytes when patching code
We switch to a new page when we detect dropped_bytes flipping from false
to true. Previously, when we patch code for invalidation during code gc,
we start with the flag being set to true, so we failed to apply patches
that straddle pages. We would write out jumps half way and then stop,
which left the code corrupted.

Reset the flag before patching so we patch across pages properly.
2022-11-08 16:09:02 -05:00
Alan Wu 1466682a23
YJIT: Improve checking message for rustc version (#6693)
Preivously we didn't have a "checking ...." line for this check and when
rustc was too old, we would dump the error message to the console like:

    checking for rustc... rustc
    error: there is no argument named `x`
     --> <anon>:1:33
      |
    1 | fn main() { let x = 1; format!("{x}"); }
      |                                 ^^^

    error: aborting due to previous error

`configure` checks usually don't do this and this might be confusing.

With this commit it now says something like:

    checking whether rustc is new enough for YJIT... no
2022-11-08 15:29:30 -05:00
Jimmy Miller 1a65ab20cb
Implement optimize call (#6691)
This dispatches to a c func for doing the dynamic lookup. I experimented with chain on the proc but wasn't able to detect which call sites would be monomorphic vs polymorphic. There is definitely room for optimization here, but it does reduce exits.
2022-11-08 15:28:28 -05:00
Matt Valentine-House aada904d94 [doc] Clarify how to build OpenSSL on macOS 2022-11-08 14:59:01 -05:00
Takashi Kokubun 5643d2bb9a
YJIT: Make more stats accessible from Ruby code (#6685) 2022-11-08 12:36:29 -05:00
Stan Lo b7b78f062f [ruby/irb] Add execute_lines to reduce command tests' boilerplate
code
(https://github.com/ruby/irb/pull/436)

https://github.com/ruby/irb/commit/1595337149
2022-11-08 17:19:59 +00:00
Bo Anderson 0df47fdaf9 [rubygems/rubygems] Add tests for universal Ruby with arch-specific prebuilt gems
https://github.com/rubygems/rubygems/commit/11229b16c3
2022-11-08 17:05:19 +00:00
Bo Anderson 2244d5084e [rubygems/rubygems] Map 'universal' to the real arch in Bundler for prebuilt gem selection
https://github.com/rubygems/rubygems/commit/dd0c94f16a
2022-11-08 17:05:18 +00:00
Maxime Chevalier-Boisvert 3703a81491
YJIT: improve/fix code to automatically build YJIT when available (#6684)
* YJIT: improve/fix code to automatically build YJIT when available

* Set YJIT_SUPPORT=no

* Fix rustc => $RUSTC
2022-11-08 11:57:11 -05:00
Jean byroot Boussier eacedcfe44
mutex: Raise a ThreadError when detecting a fiber deadlock (#6680)
[Bug #19105]

If no fiber scheduler is registered and the fiber that
owns the lock and the one that try to acquire it
both belong to the same thread, we're in a deadlock case.

Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
2022-11-09 00:43:16 +13:00
git cdb3ec3af8 Update default gems list at 4e728486b9 [ci skip] 2022-11-08 08:08:48 +00:00
Yusuke Endoh 4e728486b9 [ruby/error_highlight] Bump version
https://github.com/ruby/error_highlight/commit/59c291cce1
2022-11-08 08:07:39 +00:00
Nobuyoshi Nakada 001606097b Suppress false warning by a bug of gcc
GCC [Bug 99578] seems triggered by calling `rb_reg_last_match` before
`match_check(match)`, probably by `NIL_P(match)` in `rb_reg_nth_match`.

[Bug 99578]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578
2022-11-08 16:13:30 +09:00
Yusuke Endoh 4a7d6c2852 Fix false LocalJumpError when branch coverage is enabled
`throw TAG_BREAK` instruction makes a jump only if the continuation of
catch of TAG_BREAK exactly matches the instruction immediately following
the "send" instruction that is currently being executed. Otherwise, it
seems to determine break from proc-closure.

Branch coverage may insert some recording instructions after "send"
instruction, which broke the conditions for TAG_BREAK to work properly.

This change forces to set the continuation of catch of TAG_BREAK
immediately after "send" (or "invokesuper") instruction.

[Bug #18991]
2022-11-08 14:37:08 +09:00
yui-knk f7db1affd1 Set default %printer for NODE nterms
Before:

```
Reducing stack by rule 639 (line 5062):
   $1 = token "integer literal" (1.0-1.1: 1)
-> $$ = nterm simple_numeric (1.0-1.1: )
```

After:

```
Reducing stack by rule 641 (line 5078):
   $1 = token "integer literal" (1.0-1.1: 1)
-> $$ = nterm simple_numeric (1.0-1.1: NODE_LIT)
```

`"<*>"` is supported by Bison 2.3b (2008-05-27) or later.
https://git.savannah.gnu.org/cgit/bison.git/commit/?id=12e3584054c16ab255672c07af0ffc7bb220e8bc

Therefore developers need to install Bison 2.3b+ to build ruby from
source codes if their Bison is older.

Minimum version requirement for Bison is changed to 3.0.

See: https://bugs.ruby-lang.org/issues/19068 [Feature #19068]
2022-11-08 12:30:03 +09:00
Peter Zhu 7456647eff [DOC] Properly number the list in building_ruby.md 2022-11-07 19:47:12 -05:00
Nobuyoshi Nakada cb2323a983
Thread#native_thread_id is very platform specific 2022-11-08 09:31:58 +09:00
Peter Zhu b14f133054 [DOC] Improve building_ruby.md 2022-11-07 14:35:21 -05:00
Benoit Daloze 83decbb62b Update to ruby/spec@740ccc8 2022-11-07 20:05:30 +01:00
Benoit Daloze c99e4c4278 Update to ruby/mspec@1e16420 2022-11-07 20:05:18 +01:00
Takashi Kokubun 9001e53e68 [ruby/irb] Support non-string input in show_source
(https://github.com/ruby/irb/pull/430)

* Support non-string input in show_source

* Test show_source as a method
2022-11-07 17:29:28 +00:00
Takashi Kokubun 7442cb461b
YJIT: Free pages after ObjectSpace API usages (#6676) 2022-11-07 10:48:26 -05:00
Stan Lo ca0b592673 [ruby/irb] Don't lazily retrieve gem specs for completion
There are a few downsides of the current approach:

1. Because gem specs are lazily retrieved, this computation happens in
   every irb completion test case, which is not necessary. (In tests we
   don't cache the result of `retrieve_files_to_require_from_load_path`)
2. Gem::Specification.latest_specs is sensible to the content of
   LOAD_PATH. And when combined with 1, tests fail "randomly" if they
   try to mutate LOAD_PATH, even though the test subject it's something
   else.

So by pre-computing and storing the gem paths in a constant, it guarantees
that the computation only happens once and it doesn't get affected by test
cases.

One argument could be made against the change is that, it'll store
unnecessary data for users that disable autocompletion. But the
counter-arguments are:

1. Since autocompletion is enabled by default, this should not be the
   case for most users.
2. For users with autocompletion enabled, IRB already caches the
   result of `retrieve_files_to_require_from_load_path` in memory, which
   should have a similar size of GEM_SPECS. And we currently haven't
   received any report about problems caused by such memory consumption.

https://github.com/ruby/irb/commit/c671d39020
2022-11-07 14:44:25 +00:00
Yusuke Endoh 72c7dba436 [ruby/fileutils] Revert "FileUtils.rm* methods swallows only Errno::ENOENT when force is true"
This reverts commit https://github.com/ruby/fileutils/commit/fa65d676ece9.

This caused some incompatibility problems in real-world cases.
https://bugs.ruby-lang.org/issues/18784#change-98927
https://bugs.ruby-lang.org/issues/18784#change-98967

https://github.com/ruby/fileutils/commit/42983c2553
2022-11-07 11:25:25 +00:00
Peter Zhu 33bc398b73 [rubygems/rubygems] Fix rubocop violations
https://github.com/rubygems/rubygems/commit/cc12e68637
2022-11-07 10:52:15 +00:00
Peter Zhu b228effd0c [rubygems/rubygems] Drop support for IRIX
The IRIX OS is no longer maintained with the last release being 16 years
ago.

https://github.com/rubygems/rubygems/commit/5381c6a871
2022-11-07 10:52:14 +00:00
Peter Zhu 1e53ebae57 [rubygems/rubygems] Drop support for bitrig
The bitrig OS is no longer maintained with the last release being 7
years ago.

https://github.com/rubygems/rubygems/commit/85ed90ddd0
2022-11-07 10:52:14 +00:00
Peter Zhu 0fb7a1c77c [rubygems/rubygems] Drop support for HP-UX
Support for HP-UX was dropped in Ruby in ruby/ruby#5457.

https://github.com/rubygems/rubygems/commit/a3a8df3582
2022-11-07 10:52:13 +00:00
Nobuyoshi Nakada 011d4c57d2
[Bug #19106] Normalize time at 24:00:00 with a timezone object 2022-11-07 15:56:12 +09:00
Nobuyoshi Nakada ee86b57ee5
Revert jobserver handling in spec 2022-11-07 15:54:40 +09:00
Nobuyoshi Nakada b02b8e7756
Let other test runners follow the change of GNU make 4.4 jobserver 2022-11-07 10:08:30 +09:00
Nobuyoshi Nakada ab01b8f23f
jobserver option may not be at the last 2022-11-07 10:08:09 +09:00
Nobuyoshi Nakada 180d37c817
Set `autoclose:` for inherited FDs only [ci skip] 2022-11-07 09:06:15 +09:00
Nobuyoshi Nakada 12883f8fa6
GNU make 4.4 now uses a fifo for the jobserver 2022-11-06 23:39:55 +09:00
Nobuyoshi Nakada fc842c9ccc
Check `rustc` with the target 2022-11-06 19:32:50 +09:00
Nobuyoshi Nakada 9627aab825
`--disable-jit-support` should disable YJIT successfully
Even if `rustc` is available, it should not be an error unless
`--enable-yjit` is explicitly given.
2022-11-06 17:07:44 +09:00
Nobuyoshi Nakada cb899a990a
Disable YJIT support when cross-compiling
As the target-list of `rustc` is different from `config.guess` and
`config.sub`, `$target` cannot be used directly.
2022-11-06 10:16:12 +09:00
Nobuyoshi Nakada 1454f8f219 Add `--target` option to RUSTC when cross-compiling 2022-11-06 06:47:38 +09:00
Nobuyoshi Nakada 10fd1d9507 Should use the configured rustc consistently 2022-11-06 06:47:38 +09:00
Yuta Saito 3a6cdeda89 [wasm] Scan machine stack based on `ec->machine.stack_{start,end}`
fiber machine stack is placed outside of C stack allocated by wasm-ld,
so highest stack address recorded by `rb_wasm_record_stack_base` is
invalid when running on non-main fiber.
Therefore, we should scan `stack_{start,end}` which always point a valid
stack range in any context.
2022-11-06 05:03:21 +09:00
Yusuke Endoh 267452e6fe Sync TRICK 2018 (02-mame)
https://github.com/tric/trick2018/pull/5
2022-11-05 23:18:32 +09:00
Takashi Kokubun 9af344a421 [ruby/erb] Revert the strpbrk optimization
because it's much slower on M1 https://github.com/ruby/erb/pull/29.
It'd be too complicated to switch the implementation based on known
optimized platforms / versions.

Besides, short strings are the most common usages of this method and
SIMD doesn't really help that case. All in all, I can't justify the
existence of this code.

https://github.com/ruby/erb/commit/30691c8995
2022-11-05 08:34:32 +00:00
Takashi Kokubun 458d6fb15e [ruby/erb] Optimize away the rb_convert_type call using RB_TYPE_P
https://github.com/ruby/erb/commit/12058c3784
2022-11-05 07:52:46 +00:00
Takashi Kokubun e8873e01b6 [ruby/erb] Use strpbrk only when str is long enough for SIMD
This is the same trick used by https://github.com/k0kubun/hescape to
choose the best strategy for different scenarios.

https://github.com/ruby/erb/commit/af26da2858
2022-11-05 07:52:45 +00:00
Takashi Kokubun 419d2fc14d [ruby/erb] Optimize the no-escape case with strpbrk
(https://github.com/ruby/erb/pull/29)

Typically, strpbrk(3) is optimized pretty well with SIMD instructions.
Just using it makes this as fast as a SIMD-based implementation for the
no-escape case.

Not utilizing this for escaped cases because memory allocation would be
a more significant bottleneck for many strings anyway. Also, there'll be
some overhead in calling a C function (strpbrk) many times because we're
not using SIMD instructions directly. So using strpbrk all the time
might not necessarily be faster.
2022-11-05 06:58:48 +00:00
Takashi Kokubun f276d5a7fe
Improve HTML escape benchmarks 2022-11-04 23:54:25 -07:00