87389 Commits

Author SHA1 Message Date
Peter Zhu
2af080bd30 Change rb_gc_impl_get_profile_total_time to return unsigned long long 2024-09-17 15:22:43 -04:00
Peter Zhu
5de7517bcb Use unsigned long long for marking and sweeping time 2024-09-17 15:22:43 -04:00
Kevin Newton
748933aa1b [ruby/prism] Accept "do" blocks in some parameter default values
https://github.com/ruby/prism/commit/6d7b734dbe
2024-09-17 18:47:27 +00:00
Peter Zhu
0160dafc4c Replace all GC.disable with EnvUtil.without_gc 2024-09-17 10:34:26 -04:00
Yusuke Endoh
82151a8630 Fix a typo, sorry! 2024-09-17 23:07:44 +09:00
Yusuke Endoh
fd5e583990 Prevent two warnings
```
/home/chkbuild/chkbuild/tmp/build/20240917T123003Z/ruby/test/ruby/test_case.rb:73: warning: 'when' clause on line 73 duplicates 'when' clause on line 73 and is ignored
/home/chkbuild/chkbuild/tmp/build/20240917T123003Z/ruby/test/ruby/test_syntax.rb:333: warning: key :k1 is duplicated and overwritten on line 333
```
2024-09-17 22:52:25 +09:00
David Rodríguez
cf063c008f [rubygems/rubygems] Bump rubies in CI to 3.3.5
A spec needed changes because now loading the default `json` prints a
warning about `ostruct` getting loaded although it will be removed in
the future. Use a different default gem to test this.

https://github.com/rubygems/rubygems/commit/7415a66906

Co-authored-by: Samuel Giddins <segiddins@segiddins.me>
2024-09-17 11:10:58 +00:00
Hiroshi SHIBATA
1ecac5d4ed
TestProcess#test_daemon_noclose is working fine with macOS 15.1 beta3 and Xcode 16 RC 2024-09-17 16:16:45 +09:00
Hiroshi SHIBATA
95f08f2b7f
Skip failing examples related with d81b0588bb 2024-09-17 15:44:18 +09:00
Hiroshi SHIBATA
c0116860ba
Removed accidentally commit for snapshot file of prism 2024-09-17 15:37:20 +09:00
NAITOH Jun
d81b0588bb
[ruby/strscan] Accept String as a pattern at non head
(https://github.com/ruby/strscan/pull/106)

It supports non-head match cases such as StringScanner#scan_until.

If we use a String as a pattern, we can improve match performance.
Here is a result of the including benchmark.

## CRuby

It shows String as a pattern is 1.18x faster than Regexp as a pattern.

```
$ benchmark-driver benchmark/check_until.yaml
Warming up --------------------------------------
              regexp     9.403M i/s -      9.548M times in 1.015459s (106.35ns/i)
          regexp_var     9.162M i/s -      9.248M times in 1.009479s (109.15ns/i)
              string     8.966M i/s -      9.274M times in 1.034343s (111.54ns/i)
          string_var    11.051M i/s -     11.190M times in 1.012538s (90.49ns/i)
Calculating -------------------------------------
              regexp    10.319M i/s -     28.209M times in 2.733707s (96.91ns/i)
          regexp_var    10.032M i/s -     27.485M times in 2.739807s (99.68ns/i)
              string     9.681M i/s -     26.897M times in 2.778397s (103.30ns/i)
          string_var    12.162M i/s -     33.154M times in 2.726046s (82.22ns/i)

Comparison:
          string_var:  12161920.6 i/s
              regexp:  10318949.7 i/s - 1.18x  slower
          regexp_var:  10031617.6 i/s - 1.21x  slower
              string:   9680843.7 i/s - 1.26x  slower
```

## JRuby

It shows String as a pattern is 2.11x faster than Regexp as a pattern.

```
$ benchmark-driver benchmark/check_until.yaml
Warming up --------------------------------------
              regexp     7.591M i/s -      7.544M times in 0.993780s (131.74ns/i)
          regexp_var     6.143M i/s -      6.125M times in 0.997038s (162.77ns/i)
              string    14.135M i/s -     14.079M times in 0.996067s (70.75ns/i)
          string_var    14.079M i/s -     14.057M times in 0.998420s (71.03ns/i)
Calculating -------------------------------------
              regexp     9.409M i/s -     22.773M times in 2.420268s (106.28ns/i)
          regexp_var    10.116M i/s -     18.430M times in 1.821820s (98.85ns/i)
              string    21.389M i/s -     42.404M times in 1.982519s (46.75ns/i)
          string_var    20.897M i/s -     42.237M times in 2.021187s (47.85ns/i)

Comparison:
              string:  21389191.1 i/s
          string_var:  20897327.5 i/s - 1.02x  slower
          regexp_var:  10116464.7 i/s - 2.11x  slower
              regexp:   9409222.3 i/s - 2.27x  slower
```

See:
be7815ec02/core/src/main/java/org/jruby/util/StringSupport.java (L1706-L1736)

---------

https://github.com/ruby/strscan/commit/f9d96c446a

Co-authored-by: Sutou Kouhei <kou@clear-code.com>
2024-09-17 15:12:25 +09:00
David Rodríguez
7d80c139f7
Unlock parallel_tests 2024-09-17 14:41:19 +09:00
David Rodríguez
80e934c29c [rubygems/rubygems] Fix --local hitting the network when default gems are included
https://github.com/rubygems/rubygems/commit/b9a2d4d539
2024-09-17 14:39:06 +09:00
David Rodríguez
335d630903 [rubygems/rubygems] Improve spec
The behavior it's testing is independent from the bundle path being
used.

https://github.com/rubygems/rubygems/commit/9a4b32ec82
2024-09-17 14:39:05 +09:00
David Rodríguez
166cde7d24 [rubygems/rubygems] Fix spec to setup a default gem correctly
Looking at the description is something that used to be done a long time
ago.

https://github.com/rubygems/rubygems/commit/9c226f52a6
2024-09-17 14:39:05 +09:00
David Rodríguez
7428709d20 [rubygems/rubygems] Inline a private method
Removes an (in my opinion) excessive indirection and handles options
more consistently.

https://github.com/rubygems/rubygems/commit/642e6d2c0c
2024-09-17 14:39:04 +09:00
David Rodríguez
7e0934d33e [rubygems/rubygems] Consistently access install options through symbol keys
https://github.com/rubygems/rubygems/commit/7ddf1dc70a
2024-09-17 14:39:04 +09:00
Yusuke Endoh
70111fcc45 Prevent a warning due to error recovery of prism 2024-09-17 14:15:44 +09:00
Yusuke Endoh
d90da9408d Prevent warnings for RubyVM::AbstractSyntaxTree.parse in test_ast.rb 2024-09-17 14:10:49 +09:00
Yusuke Endoh
d84b062b63 Prevent warning: assigned but unused variable - message 2024-09-17 13:56:04 +09:00
dependabot[bot]
4ca588eede Bump github/codeql-action from 3.26.6 to 3.26.7
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.6 to 3.26.7.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](4dd16135b6...8214744c54)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-17 12:54:00 +09:00
Nikolay Ponomarev
bb2d24731e [DOC] Fix autoload method formatting 2024-09-17 12:52:31 +09:00
Hiroshi SHIBATA
bb7025b7e8
Activate irb if irb is bundled gems 2024-09-17 12:46:01 +09:00
Yusuke Endoh
76d927f88f Prevent prism warnings in syntax exhaustive tests
[Bug #20736]
2024-09-17 12:44:07 +09:00
KJ Tsanaktsidis
e08d5239b6 Ensure fiber scheduler is woken up when close interrupts read
If one thread is reading and another closes that socket, the close
blocks waiting for the read to abort cleanly. This ensures that Ruby is
totally done with the file descriptor _BEFORE_ we tell the OS to close
and potentially re-use it.

When the read is correctly terminated, the close should be unblocked.
That currently works if closing is happening on a thread, but if it's
happening on a fiber with a fiber scheduler, it does NOT work.

This patch ensures that if the close happened in a fiber scheduled
thread, that the scheduler is notified that the fiber is unblocked.

[Bug #20723]
2024-09-17 10:11:44 +10:00
Peter Zhu
50d4840bd9 Move desired_compaction_pages_i inside of GC_CAN_COMPILE_COMPACTION
Fixes the following warning on WebAssembly:

    gc/default.c:7306:1: warning: unused function 'desired_compaction_pages_i' [-Wunused-function]
    desired_compaction_pages_i(struct heap_page *page, void *data)
2024-09-16 15:58:27 -04:00
Kevin Newton
7e2ae30f8b [ruby/prism] Handle retry doubly nested under rescue
Fixes [Bug #20747]

https://github.com/ruby/prism/commit/d3194715a9
2024-09-16 19:55:29 +00:00
Kevin Newton
2ea1950510 [ruby/prism] Do not leak explicit encoding
Fixes [Bug #20744]

https://github.com/ruby/prism/commit/f1b8b1b2a2
2024-09-16 18:57:54 +00:00
Peter Zhu
1e53e46275 Don't export unnecessary string functions
These functions are not used publicly, so we don't need to export them.
2024-09-16 14:38:49 -04:00
Kevin Newton
2beb4c6e87 [PRISM] Assume an eval context for RubyVM::ISEQ compile
Fixes [Bug #20741]
2024-09-16 14:31:01 -04:00
tomoya ishida
6c4ce72609 [ruby/irb] Use InstructionSequence#script_lines to get method source
(https://github.com/ruby/irb/pull/1005)

It works with both prism and parse.y

https://github.com/ruby/irb/commit/bcfaa72d5a
2024-09-16 17:36:27 +00:00
BurdetteLamar
1c3981cb88 [DOC] Tweaks for Array#select! 2024-09-16 12:33:42 -04:00
BurdetteLamar
4e17fa2906 Tweaks or Array#select 2024-09-16 12:33:07 -04:00
Kevin Newton
1e52dde82a [PRISM] Match defined behavior for explicit block
Fixes [Bug #20748]
2024-09-16 11:53:56 -04:00
Peter Zhu
50564f8882 ASAN unpoison whole heap page after adding to size pool 2024-09-16 09:27:29 -04:00
Peter Zhu
46ba3752c2 Don't return inside of asan_unpoisoning_object 2024-09-16 09:27:29 -04:00
Peter Zhu
c5a782dfb0 Replace with asan_unpoisoning_object 2024-09-16 09:27:29 -04:00
David Rodríguez
f4f46af958 Complete spec
Co-authored-by: Vít Ondruch <vondruch@redhat.com>
2024-09-16 13:13:43 +00:00
David Rodríguez
2bfeedc082 [rubygems/rubygems] Simplify handling default gem caching
By the time `cached_gem` is called, default gem cache has already been
handled. So no need to try redownload it again, it's enough to check the
cache location directly.

https://github.com/rubygems/rubygems/commit/70e10236b6
2024-09-16 13:13:43 +00:00
Kevin Newton
d57bc870ac [PRISM] Remove snapshot testing from Prism sync 2024-09-16 08:44:19 -04:00
David Rodríguez
fab01b15e9 [rubygems/rubygems] Remove temporary .lock files left around by gem installer
https://github.com/rubygems/rubygems/commit/edbb2e3475
2024-09-16 11:37:58 +00:00
David Rodríguez
7411caa103 [rubygems/rubygems] Make sure implementations of Gem.open_file_with_flock match
https://github.com/rubygems/rubygems/commit/174a8e5284
2024-09-16 11:37:58 +00:00
Yusuke Endoh
532af89e3b Prevent warnings: the block passed to ... may be ignored 2024-09-15 10:06:11 +09:00
Yusuke Endoh
bc13ec735b Prevent warnings: assigned but unused variable 2024-09-15 10:05:57 +09:00
Kevin Newton
ddbd644001 [ruby/prism] Stat file first to check directory
https://github.com/ruby/prism/commit/4ed7de537b
2024-09-13 19:30:57 +00:00
Kevin Newton
f85efc9748 [ruby/prism] Expose main_script in serialization API
https://github.com/ruby/prism/commit/0b527ca93f
2024-09-13 19:13:21 +00:00
Kevin Newton
77521afac1 [PRISM] Do not warn ambiguous ampersand when symbol literal
Fixes [Bug #20735]
2024-09-13 14:09:02 -04:00
Kevin Newton
9afc6a981d [PRISM] Only parse shebang on main script
Fixes [Bug #20730]
2024-09-13 12:51:53 -04:00
Kevin Newton
d42d19059d [PRISM] Allow case/when to be indented with no warning
Fixes [Bug #20731]
2024-09-13 12:51:36 -04:00
Kevin Newton
74f315c3f5 [PRISM] Turn off mismatched indentation warnings in eval
Fixes [Bug #20732]
2024-09-13 12:08:56 -04:00