91898 Commits

Author SHA1 Message Date
Nobuyoshi Nakada
e1adb6cb15
Win: Suppress false warnings from Visual C 17.14.1
https://developercommunity.visualstudio.com/t/warning-C5287:-operands-are-different-e/10877942?

It is not able to silence "operands are different enum types"
warnings, even using an explicit cast, as the message says.
2025-05-27 15:26:24 +09:00
Peter Zhu
be5450467b Fix reference updating for id2ref table
The id2ref table could contain dead entries which should not be passed
into rb_gc_location. Also, we already update references in gc_update_references
using rb_gc_vm_weak_table_foreach so we do not need to update it again.
2025-05-27 08:22:26 +02:00
Jeremy Evans
061d36476f Remove set library from maintainers doc, as Set is now a core class 2025-05-27 09:41:09 +09:00
Peter Zhu
386f874816 Don't copy FL_PROMOTED to new object in Ractor move
We should not copy the FL_PROMOTED flag when we move an object in Ractor#send(move: true)
because the newly created object may not be old.
2025-05-26 15:04:00 -04:00
BurdetteLamar
909a0daab6 [DOC] More tweaks for String#byteindex 2025-05-26 13:42:35 -04:00
John Hawthorn
f483befd90 Add shape_id to RBasic under 32 bit
This makes `RBobject` `4B` larger on 32 bit systems
but simplifies the implementation a lot.

[Feature #21353]

Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
2025-05-26 10:31:54 +02:00
git
2295384a5a Update default gems list at 874469e7cefc6a08afb8fb30556786 [ci skip] 2025-05-26 02:47:26 +00:00
dependabot[bot]
874469e7ce
[rubygems/rubygems] Bump the rb-sys group across 2 directories with 1 update
Bumps the rb-sys group with 1 update in the /test/rubygems/test_gem_ext_cargo_builder/custom_name/ext/custom_name_lib directory: [rb-sys](https://github.com/oxidize-rb/rb-sys).
Bumps the rb-sys group with 1 update in the /test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example directory: [rb-sys](https://github.com/oxidize-rb/rb-sys).

Updates `rb-sys` from 0.9.111 to 0.9.115
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.111...v0.9.115)

Updates `rb-sys` from 0.9.111 to 0.9.115
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.111...v0.9.115)

---
updated-dependencies:
- dependency-name: rb-sys
  dependency-version: 0.9.115
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rb-sys
- dependency-name: rb-sys
  dependency-version: 0.9.115
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rb-sys
...

Signed-off-by: dependabot[bot] <support@github.com>

https://github.com/rubygems/rubygems/commit/a7c0ff5641
2025-05-26 11:46:13 +09:00
Samuel Giddins
485ee6d7a3
[rubygems/rubygems] Remove backport of LATEST_RUBY_WITHOUT_PATCH_VERSIONS
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

https://github.com/rubygems/rubygems/commit/24c8073b24
2025-05-26 11:46:12 +09:00
Samuel Giddins
d8d0da5713
[rubygems/rubygems] Remove platform backports from bundler
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

https://github.com/rubygems/rubygems/commit/9336d3811c
2025-05-26 11:46:12 +09:00
Samuel Giddins
af27688697
[rubygems/rubygems] Remove reference to validate_rust_builder_rubygems_version
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

https://github.com/rubygems/rubygems/commit/f8baf13ab0
2025-05-26 11:46:12 +09:00
Samuel Giddins
c9ba3d0bac
[rubygems/rubygems] Bump required_ruby_version to 3.2
Ruby 3.1 was EOL March 2025

Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

https://github.com/rubygems/rubygems/commit/29c21b1e78
2025-05-26 11:46:12 +09:00
Jean Boussier
d565d809af
[ruby/json] Release 2.12.2
https://github.com/ruby/json/commit/a29cb77d52
2025-05-26 11:46:12 +09:00
Jean Boussier
54a314233c
[ruby/json] Release 2.12.1
https://github.com/ruby/json/commit/8603a57a91
2025-05-26 11:46:12 +09:00
Jean Boussier
212213a552
[ruby/json] fbuffer.c: add debug mode with bound checks.
This would have caught https://github.com/ruby/json/pull/808
on CI.

https://github.com/ruby/json/commit/8109421fb4
2025-05-26 11:46:12 +09:00
Jean Boussier
f171a263f7
[ruby/json] Fix: generate_json_float to reserve enough memory for large negative floats.
Fix: https://github.com/ruby/json/issues/807

Since https://github.com/ruby/json/pull/800, `fpconv_dtoa` can actually
generate up to 28 chars.

https://github.com/ruby/json/commit/d73ae93d3c
2025-05-26 11:46:12 +09:00
git
aa00a2d07b * remove trailing spaces. [ci skip] 2025-05-26 02:44:58 +00:00
Nobuyoshi Nakada
aad9fa2853
Use RB_VM_LOCKING 2025-05-25 15:22:43 +09:00
Nobuyoshi Nakada
fc518fe1ff
Delimit the scopes using encoding/symbol tables 2025-05-25 15:22:43 +09:00
Nobuyoshi Nakada
f2ca66fefc
Add RB_VM_LOCKING macro which delimits the variable scope 2025-05-25 15:22:42 +09:00
Max Bernstein
87d340f0e1 ZJIT: Parse branchnil into HIR 2025-05-23 16:31:28 -07:00
Max Bernstein
fa474a41e8 ZJIT: Parse opt_aref into HIR 2025-05-23 16:31:28 -07:00
Max Bernstein
5905f71a34 ZJIT: Add fast-paths for Array#length and Array#size 2025-05-23 16:31:28 -07:00
Luke Gruber
2b5a674440 ractor_wakeup was broken when compiled with USE_RUBY_DEBUG_LOG
The `ractor_wakeup` function takes an optional `th` argument, so it can be NULL.
There is a macro call to RUBY_DEBUG_LOG that dereferences `th` without checking
if it's NULL first. To fix this, we never dereference `th` in this macro call.
2025-05-23 16:02:48 -07:00
Max Bernstein
75b92c5cd6 ZJIT: Implement find for Defined 2025-05-23 13:32:49 -07:00
Max Bernstein
15618b7707 ZJIT: Mark SideExit as terminator 2025-05-23 13:32:49 -07:00
Max Bernstein
d23fe287b6 ZJIT: Side-exit into the interpreter on unknown call types 2025-05-23 13:32:49 -07:00
Max Bernstein
a0df4cf6f1 ZJIT: Side-exit into the interpreter on unknown opt_newarray_send 2025-05-23 13:32:49 -07:00
Max Bernstein
0c29ff8e8f ZJIT: Side-exit into the interpreter on unknown opcodes
No need to bail out of compilation completely; we can compile all the
code up until that point.
2025-05-23 13:32:49 -07:00
Étienne Barrié
2a951f62e1 Change test to avoid stack overflow with MN threads
When using MN threads (such as running the test in a ractor), this test
failed because it was raising a SystemStackError: stack level too deep.

This is because the machine stack is smaller under MN threads than on
the native main thread.
2025-05-23 21:28:16 +02:00
Luke Gruber
f64c89f18d Fix 'require' from a ractor when the required file raises an error
If you catch an error that was raised from a file you required in
a ractor, that error did not have its belonging reset from the main
ractor to the current ractor, so you hit assertion errors in debug
mode.
2025-05-23 21:13:23 +02:00
Max Bernstein
b7e751181e
ZJIT: Parse splatarray, concattoarray, pushtoarray into HIR (#13429) 2025-05-23 11:43:17 -07:00
Peter Zhu
e00c46017b Drop unnecessary compiler guards for memory_sanitizer
We unpoison slots allocated out of the GC, so we don't need to disable
the assertions that read from the memory.
2025-05-23 14:35:56 -04:00
Peter Zhu
9130023cf5 Remove dependency on bits.h in default.c when BUILDING_MODULAR_GC
We can assume that the compiler will have __builtin_clzll so we can implement
nlz_int64 using that.
2025-05-23 14:35:56 -04:00
John Hawthorn
4f9f2243e9 Stricter assert for RCLASS_ALLOCATOR
I'd like to make this only valid to T_CLASS also, but currently it is
called in some places for T_ICLASS and expected to return 0.
2025-05-23 10:33:48 -07:00
John Hawthorn
05cdcfcefd Only call RCLASS_SET_ALLOCATOR on T_CLASS objects
It's invalid to set an allocator on a T_ICLASS or T_MODULE, as those use
the other fields from the union.
2025-05-23 10:33:48 -07:00
John Hawthorn
e01e89f55c Avoid calling RCLASS_SUPER in rb_class_superclass 2025-05-23 10:22:24 -07:00
John Hawthorn
11ad7f5f47 Don't use namespaced classext for superclasses
Superclasses can't be modified by user code, so do not need namespace
indirection. For example Object.superclass is always BasicObject, no
matter what modules are included onto it.
2025-05-23 10:22:24 -07:00
Jean Boussier
1435ea7f44 Add missing lock for Module#remove_instance_variable
We must take a lock to ensure another ractor isn't reading the ivars
while we're moving them.
2025-05-23 17:33:17 +02:00
Jean Boussier
52da5f8bbc Refactor rb_shape_transition_remove_ivar
Move the fields management logic in `rb_ivar_delete`, and keep
shape managment logic in `rb_shape_transition_remove_ivar`.
2025-05-23 17:33:17 +02:00
Peter Zhu
746d7fef92 Fix moving old objects between Ractors
The FL_PROMOTED flag was not copied when moving objects, causing assertions
to fail when an old object is moved:

    gc/default/default.c:834: Assertion Failed: RVALUE_AGE_SET:age <= RVALUE_OLD_AGE

Co-Authored-By: Luke Gruber <luke.gruber@shopify.com>
2025-05-23 11:06:53 -04:00
Alan Wu
54bed7e257 [DOC] ZJIT: Function::find: Give advice instead of talking about safety
Co-Authored-By: Max Bernstein <max.bernstein@shopify.com>
2025-05-23 23:51:14 +09:00
Ufuk Kayserilioglu
224a02f924 [ruby/prism] Monomorphise visitor methods
The current implementation of the visitor pattern in Prism uses
a single method (`visit_child_nodes`) to handle all node types. This can lead to performance issues since the `node` argument will end up being polymorphic, and will prevent effective use of inline caches, which in CRuby are monomorphic.

This commit generates an inlined version of the previous code for each node type, thus making the calls inside visitor methods monomorphic. This should improve performance, especially in cases where the visitor is called frequently.

https://github.com/ruby/prism/commit/60d324a701
2025-05-23 14:22:47 +00:00
Daisuke Fujimura (fd0)
70f8f7c4b1 Fix warning on cygwin 2025-05-23 20:49:19 +09:00
Luke Gruber
966fcb77e4 lock vm around rb_free_generic_ivar
Currently, this can be reproduced by:

r = Ractor.new do
    a = [1, 2, 3]
    a.object_id
    a.dup # this frees the generic ivar for `object_id` on the copied object
    :done
end
r.take

In debug builds, this hits an assertion failure without this fix.
2025-05-23 18:20:35 +09:00
Samuel Williams
627a5ac53b
Bump fiber scheduler version and add missing documentation. (#13424) 2025-05-23 16:20:33 +09:00
Koichi Sasada
64c520fc25 skip the test now we couldn't fix
The following error is reported repeatedly on my riscv64-linux machine, so just skipt it.
I hope someone investigate it.

```
  1) Error:
TestStruct::SubStruct#test_named_structs_are_not_rooted:
Test::Unit::ProxyError: execution of Test::Unit::CoreAssertions#assert_no_memory_leak expired timeout (10 sec)
pid 1113858 killed by SIGTERM (signal 15)
| ruby 3.5.0dev (2025-05-22T21:05:12Z master 9583b7af8f) +PRISM [riscv64-linux]
|
| [7;1m1096282:1747967727.622:d70f:[mSTART={peak:453828608,size:453763072,lck:0,pin:0,hwm:9601024,rss:9601024,data:445943808,stk:135168,exe:4096,lib:7450624,pte:77824,swap:0}
| [7;1m1096282:1747967727.622:d70f:[mFINAL={peak:457502720,size:457498624,lck:0,pin:0,hwm:13312000,rss:13312000,data:449679360,stk:135168,exe:4096,lib:7450624,pte:86016,swap:0}
```
2025-05-23 15:03:10 +09:00
Samuel Williams
73c9d6ccaa
Allow IO#close to interrupt IO operations on fibers using fiber_interrupt hook. (#12839) 2025-05-23 14:55:05 +09:00
Aaron Patterson
e32054736f Remove assertion on field in class_duplicate_iclass_classext
`ext` is newly allocated so it shouldn't need an assertion. The class
ext (which is always from the module) that we're passing to
`class_duplicate_iclass_classext` could legitimately have instance
variables on it.  We just want to avoid copying them.

The assertion was making this crash:

```
$ RUBY_NAMESPACE=1 ./miniruby -e1
```
2025-05-22 22:12:42 -07:00
Max Bernstein
9583b7af8f ZJIT: Parse newhash into HIR 2025-05-22 14:05:12 -07:00