91898 Commits

Author SHA1 Message Date
Max Bernstein
f1fe3d809f ZJIT: Parse duphash into HIR 2025-05-22 14:05:12 -07:00
Max Bernstein
5a3f3f0917
ZJIT: Parse getinstancevariable, setinstancevariable into HIR (#13413) 2025-05-22 11:51:05 -07:00
Stan Lo
d96e9bd03a
[DOC] Set canonical root for online docs (#13410) 2025-05-22 09:18:46 -07:00
Burdette Lamar
b080aabb22 Update string.rb
Co-authored-by: Peter Zhu <peter@peterzhu.ca>
2025-05-22 10:17:46 -04:00
BurdetteLamar
3403055d13 [DOC] Tweaks for String#byteindex 2025-05-22 10:17:46 -04:00
Jean Boussier
f18883b295 Namespaces: Don't initialize fields for T_ICLASS
ICLASS don't have instance variables or anything like that.

`gc_mark_classext_iclass` didn't mark it, and `classext_iclass_free`
wasn't freeing it.
2025-05-22 12:10:10 +02:00
Nobuyoshi Nakada
ec41b1e823 Fix for old mingw without clock_gettime and clock_getres 2025-05-22 13:08:39 +09:00
Daniel Colson
0564973196 [Bug #21357] Fix crash in Hash#merge with block
Prior to 49b306ecb9
the `optional_arg` passed from `rb_hash_update_block_i` to `tbl_update`
was a hash value (i.e. a VALUE). After that commit it changed to an
`update_call_args`.

If the block sets or changes the value, `tbl_update_modify` will set the
`arg.value` back to an actual value and we won't crash. But in the case
where the block returns the original value we end up calling
`RB_OBJ_WRITTEN` with the `update_call_args` which is not expected and
may crash.

`arg.value` appears to only be used to pass to `RB_OBJ_WRITTEN` (others
who need the `update_call_args` get it from `arg.arg`), so I don't think
it needs to be set to anything upfront. And `tbl_update_modify` will set
the `arg.value` in the cases we need the write barrier.
2025-05-22 12:25:55 +09:00
Nobuyoshi Nakada
7154b4208b
Fix a -Wmaybe-uninitialized
lev in rb_gc_vm_lock() is uninitialized in single ractor mode.
2025-05-22 10:55:19 +09:00
John Hawthorn
6a16c3e26d Remove too_complex GC assertion
Classes from the default namespace are not writable, however they do not
transition to too_complex until they have been written to inside a user
namespace. So this assertion is invalid (as is the previous location it
was) but it doesn't seem to provide us much value.

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2025-05-21 17:23:18 -07:00
John Hawthorn
7b10660974 Use rb_inspect for Ractor error
Previously the object was used directly, which calls `to_s` if defined.
We should use rb_inspect to get a value suitable for display to the
programmer.
2025-05-21 12:23:14 -07:00
Aaron Patterson
ef935705cf Use shape_id for determining "too complex"
Using `rb_shape_obj_too_complex_p` looks up the shape, but we already
have the shape id. This avoids looking up the shape twice.
2025-05-21 10:27:14 -07:00
Aaron Patterson
6df6aaa036 Update class.c
Co-authored-by: Satoshi Tagomori <tagomoris@gmail.com>
2025-05-21 09:51:32 -07:00
Aaron Patterson
6ea893f376 Add assertion for RCLASS_SET_PRIME_CLASSEXT_WRITABLE
When classes are booted, they should all be writeable unless namespaces
are enabled.  This commit adds an assertion to ensure that classes are
writable.
2025-05-21 09:51:32 -07:00
Peter Zhu
511b6bcb53 Reenable MMTk tests 2025-05-21 11:27:02 -04:00
Peter Zhu
ac23fa0902 Use rb_id_table_foreach_values for mark_cc_tbl
We don't need the key, so we can improve performance by only iterating
on the value.

This will also fix the MMTk build because looking up the key in
rb_id_table_foreach requires locking the VM, which is not supported in
the MMTk worker threads.
2025-05-21 11:27:02 -04:00
Alan Wu
b4c900debd ZJIT: More type level docs in zjit::hir [DOC]
Given `InsnId` is at the top of the file and everywhere, hopefully this
will help first time readers.
2025-05-22 00:23:19 +09:00
Peter Zhu
3487117e55 [ruby/mmtk] Fix object ID in rb_gc_impl_define_finalizer
The 0th element of the finalizer table array should be the object ID.

https://github.com/ruby/mmtk/commit/75e4a82652
2025-05-21 14:35:36 +00:00
Alan Wu
8f50bb7c24 JITs: Add back MACOSX_DEPLOYMENT_TARGET=11.0 setting to avoid warning
See: 41251fdd309d4ff8f699268e33c32a114257211e
2025-05-21 22:48:20 +09:00
Richard Böhme
9a41d76b83 Fix one-by-one error of numbered parameter ID 2025-05-21 22:12:34 +09:00
Hiroshi SHIBATA
081a44f586 Disabled TRAP cache of CodeQL again 2025-05-21 17:11:15 +09:00
Jean Boussier
0964593e5d Shrink sym_proc_cache by half
There is no need to store the symbol and the proc given the
proc has a reference to the symbol.

This makes the cache half as small, now fitting in an object
slot, but also make it easier to allow that cache to be
used by ractors, assuming we'd make `Symbol#to_proc`
return a shareable proc.
2025-05-21 09:29:27 +02:00
Stan Lo
c980cab155 [DOC] Add bundled gem doc links
- rake
- reline
- logger
- csv
- rexml
- racc
2025-05-21 16:08:42 +09:00
git
df66d2befb Update bundled gems list as of 2025-05-21 2025-05-21 07:03:43 +00:00
Luke Gruber
f6cbf499bc Fix Symbol#to_proc (rb_sym_to_proc) to be ractor safe
In non-main ractors, don't use `sym_proc_cache`. It is not thread-safe
to add to this array without a lock and also it leaks procs from one
ractor to another. Instead, we create a new proc each time. If this
results in poor performance we can come up with a solution later.

Fixes [Bug #21354]
2025-05-21 08:12:18 +02:00
Hiroshi SHIBATA
97e774b95d [rubygems/rubygems] Bump up to rack-3.1.15 that is removed dependency of CGI::Cookie
https://github.com/rubygems/rubygems/commit/cecc280f61
2025-05-21 11:33:33 +09:00
Nathan Ladd
3ac239f790 [rubygems/rubygems] Copy prerelease attribute to dependency resolver sets
https://github.com/rubygems/rubygems/commit/5956e7f8e5
2025-05-21 11:33:32 +09:00
Peter Zhu
27b0638386 [ruby/mmtk] Fix object ID for finalizers
We should get the object ID for finalizers in rb_gc_impl_define_finalizer
instead of when we create the finalizer job in make_final_job because
when we are in multi-Ractor mode, object ID needs to walk the references
which allocates an identity hash table. We cannot allocate in make_final_job
because it is in a MMTk worker thread.

https://github.com/ruby/mmtk/commit/922f22a690
2025-05-21 02:30:33 +00:00
Aaron Patterson
1c66124273 Make Addrinfo objects Ractor shareable
Allow Addrinfo objects to be shared among Ractors.  Addrinfo objects are
already immutable, so I think it's safe for us to tag them as
RUBY_TYPED_FROZEN_SHAREABLE shareable too.
2025-05-20 18:04:37 -07:00
Max Bernstein
b08e20d34a
ZJIT: Allow DCE to remove some CCalls (#13363)
Allow DCE to remove some CCalls

Add `elidable` field that signals that there would be no discernible
effect if the call to the method were removed. The default is false.
2025-05-20 15:41:37 -07:00
Peter Zhu
b043abc048 Only define RVALUE_OVERHEAD if undefined
This allows RVALUE_OVERHEAD to be defined elsewhere.
2025-05-20 12:57:23 -04:00
John Hawthorn
84bfcaa80d Add two more TSan suppressions 2025-05-20 09:56:31 -07:00
John Hawthorn
e7f97eb2f3 Use atomic load for signal buff size 2025-05-20 09:56:31 -07:00
John Hawthorn
05e0e7223a Use atomic load to read interrupt mask 2025-05-20 09:56:31 -07:00
Alan Wu
cd15cc250f ZJIT: Run make zjit-test under combo build with YJIT 2025-05-21 01:22:55 +09:00
Alan Wu
1fed568e3e ZJIT: Add --allow-multiple-definition for make zjit-test 2025-05-21 01:22:55 +09:00
Alan Wu
2297afda7f
Include stdbool.h without checking with autoconf
As reported in <https://bugs.ruby-lang.org/issues/21340>, older autoconf
have an AC_HEADER_STDBOOL that's incompatible with C23. Autoconf 2.72
fixed the macro, but also mentions that it's obsolescent since all
current compilers have this header.

Since we require C99 [1] and VS 2015 [2], we might actually be able take
that suggestion and include stdbool.h without a check. I want to try
this on rubyci.org and will revert if this cause any issues. Not
touching AC_HEADER_STDBOOL in configure.ac for now.

[1]: https://bugs.ruby-lang.org/issues/15347
[2]: https://bugs.ruby-lang.org/issues/19982
2025-05-20 15:58:32 +00:00
Alan Wu
ce5eb2803e YJIT: ZJIT: CI: Smoke test for --[y,z]jit-dump-disasm 2025-05-21 00:35:56 +09:00
Alan Wu
dfc0fe3679 Add jit.rs as dependency in Makefile 2025-05-21 00:35:56 +09:00
Nobuyoshi Nakada
bf082a37a9
CI: Check if runnable first, before set up directories 2025-05-20 22:27:51 +09:00
Nobuyoshi Nakada
d0a8f6baa7
[DOC] Fix call-seq of Dir.glob
`patterns` may be an array but not the rest argument.
2025-05-20 22:12:58 +09:00
Nobuyoshi Nakada
8dbff6e402
Silence error messages of cd to non-existent opt directories 2025-05-20 20:43:58 +09:00
Earlopain
a82e7132df Fix uplevel for cgi under bundler
Since there is `bundled_gems.rb` it is not always one. Fixes the following:
```sh
$ ruby -w -rbundler/inline -e "gemfile {}; require 'cgi'"
/home/earlopain/.rbenv/versions/ruby-dev/lib/ruby/3.5.0+0/bundled_gems.rb:59: warning: CGI library is removed from Ruby 3.5. Please use cgi/escape instead for CGI.escape and CGI.unescape features.
If you need to use the full features of CGI library, Please install cgi gem.
```

into:

```sh
$ ruby -w -rbundler/inline -e "gemfile {}; require 'cgi'"
-e:1: warning: CGI library is removed from Ruby 3.5. Please use cgi/escape instead for CGI.escape and CGI.unescape features.
If you need to use the full features of CGI library, Please install cgi gem.
```
2025-05-20 18:22:41 +09:00
git
bfe89c7a90 Update bundled gems list as of 2025-05-19 2025-05-20 07:03:43 +00:00
Daisuke Aritomo
edff523407 [DOC] Describe new return value of source_location
Proc#source_location, Method#source_location and
UnboundMethod#source_location carry more information since
073c4e1cc712064e626914fa4a5a8061f903a637.

https://bugs.ruby-lang.org/issues/6012
https://github.com/ruby/ruby/pull/12539
2025-05-20 15:51:42 +09:00
Jeremy Evans
c52f4eea56 Remove SortedSet autoload and set/sorted_set
Implements [Feature #21287]
2025-05-20 13:34:31 +09:00
Takashi Kokubun
a7ef9a44a6
ZJIT: Propagate disasm feature to ZJIT and YJIT (#13372)
Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
2025-05-19 10:34:29 -07:00
Nobuyoshi Nakada
93ce95d46c
[DOC] Fix indentation
RDoc markdown parser requires exact 4 spaces or tab as indentation.
2025-05-19 22:49:22 +09:00
Nobuyoshi Nakada
22c1201bba
[DOC] Fold long lines 2025-05-19 22:47:07 +09:00
Nobuyoshi Nakada
d84f20319c
[DOC] Escape dot in regexp 2025-05-19 22:41:56 +09:00