Commit graph

91503 commits

Author SHA1 Message Date
Yuta Saito
186022d13f wasm: increase the default Asyncify buffer size
We will need more Asyncify space for the upcoming namespace changes
as it will introduce more local variables and conditional jumps in
asyncify'd functions.
2025-05-03 01:36:13 +08:00
Alan Wu
33909a1c69 YJIT: ZJIT: Share identical glue functions
Working towards having YJIT and ZJIT in the same build, we need to
deduplicate some glue code that would otherwise cause name collision.
Add jit.c for this and build it for YJIT and ZJIT builds. Update bindgen
to look at jit.c; some shuffling of functions in the output, but the set
of functions shouldn't have changed.
2025-05-02 23:47:57 +09:00
Alan Wu
aafd10616d Add an include guard for insns_info.inc
The JIT bindgens need this.
2025-05-02 23:47:57 +09:00
Alan Wu
dd0e0eb4ac Delete always true assert [ci skip] 2025-05-02 21:06:11 +09:00
Nobuyoshi Nakada
85198262a3 [ruby/digest] Suppress false stringop-overread warning
0df846e8c1
2025-05-02 09:46:51 +00:00
Nobuyoshi Nakada
277bcb717b [ruby/digest] Move macros for warnings to defs.h
70a805b872
2025-05-02 09:46:51 +00:00
Nobuyoshi Nakada
ba6a36e653 [ruby/digest] Fix --without-common-digest option
In `digest_conf`, "no implicit conversion of false into String"
TypeError is raised.

89e5e5fe3a
2025-05-02 09:20:47 +00:00
Nobuyoshi Nakada
430789dec4 [ruby/psych] Ensure to remove the test constants
dd3685aa67
2025-05-02 06:27:11 +00:00
git
d2a0e98c78 Update default gems list at 0f06626915 [ci skip] 2025-05-02 01:40:59 +00:00
Hiroshi SHIBATA
0f06626915
Bump up strscan version to 3.1.5.dev 2025-05-02 10:11:09 +09:00
Sutou Kouhei
af6d6b64ea [ruby/strscan] named_captures: fix incompatibility with
MatchData#named_captures
(https://github.com/ruby/strscan/pull/146)

Fix https://github.com/ruby/strscan/pull/145

`MatchData#named_captures` use the last matched value for each name.

Reported by Linus Sellberg. Thanks!!!

a6086ea322
2025-05-02 09:52:38 +09:00
nick evans
a1e627b7e3
[ruby/psych] Use rb_struct_initialize to initialize Data
3573fb356e
2025-05-02 09:49:15 +09:00
Mike Perham
5d0708378e
[rubygems/rubygems] Smoother authentication experience
Copying the URL is painful here because the URL is embedded within a paragraph of text. I presume we don't want to automatically open the browser.

Instead, move the URL to its own line so that "triple click" will automatically select the whole thing.

21532a69ae
2025-05-02 09:49:15 +09:00
Hiroshi SHIBATA
69bb2b3bb2
Set is migrated to Core class 2025-05-02 09:49:15 +09:00
Daniel Colson
48a360baa4 Fix C level backtraces for USE_ELF
After upgrading GitHub to Ruby 3.4 we noticed that we stopped getting
useful C level backtrace information in our crash reports. We traced it
back to 7dd2afbe3a.

Passing 0 instead of -1 made sense for the Mach-O version of
`fill_lines`, but there is a separate ELF version of `fill_lines` that
still has special handling for -1: 58e3aa0224/addr2line.c (L2178-L2209)

Without this special handling for the main executable, we don't have the
right `base_addr` when reading debug info, and so we fail to populate
the information for that line: 58e3aa0224/addr2line.c (L1948)
Then we get to 58e3aa0224/addr2line.c (L2649),
and potentially (depending on how things were run) get back `"ruby"` as
`info.dli_fname` instead of the absolute path for the executable. We set
that as the `binary_filename` and then try to open it inside the next
call to `fill_lines`, but that fails (unless you happen to be in the
directory where the ruby executable lives) and break out of filling
lines entirely: 58e3aa0224/addr2line.c (L2673-L2674)

This commit treats offset 0 as the main executable, rather than having
a special meaning for -1 (which gets turned into 0 anyway).

[Bug #21289]
2025-05-01 16:58:06 -07:00
Sam Rawlins
3176cd6993 [ruby/psych] fix error in @dispatch_catch
9df5501fdc
2025-05-01 17:54:18 +00:00
nick evans
136dc52663 Add support for Data objects with ivars
This sets the ivars _before_ calling initialize, which feels wrong.  But
Data doesn't give us any mechanism for setting the members other than 1)
initialize, or 2) drop down into the C API.  Since initialize freezes
the object, we need to set the ivars before that.  I think this is a
reasonable compromise—if users need better handling, they can implement
their own `encode_with` and `init_with`.  But it will lead to unhappy
surprises for some users.

Alternatively, we could use the C API, similarly to Marshal.  Psych _is_
already using the C API for path2class and build_exception.  This would
be the least surprising behavior for users, I think.
2025-05-01 17:52:14 +00:00
nick evans
a397e4d4b0 [ruby/psych] Add support for ruby 3.2 Data objects
788b844c83
2025-05-01 17:52:13 +00:00
Martin Meyerhoff
bd1d6e8cd7 [ruby/psych] Fix loading/parsing regular expressions
This fixes the issue where regular expression would come back slightly
different after going through a YAML load/dump cycle. Because we're used
to having to escape forward slashes in regular expression literals
(because the literal is delimited by slashes), but the deserializer
takes the literal output from `Regexp#inspect` and feeds it as a string
into `Regexp.new`, which expects a string, not a Regexp literal, cycling
did not properly work before this commit.

I've also changed the code to be a bit more readable, I hope this
doesn't affect performance.

f4dd8dadad
2025-05-01 17:50:13 +00:00
Takashi Kokubun
67b91e7807 Drop an ignored attribute
GCC 13.3.0 (Ubuntu 24.04) emits the following warning:

../symbol.c: In function ‘rb_id_attrset’:
../symbol.c:175:9: warning: ‘nonstring’ attribute ignored on objects of type ‘const char[][8]’ [-Wattributes]
  175 |         RBIMPL_ATTR_NONSTRING() static const char id_types[][8] = {
      |         ^~~~~~~~~~~~~~~~~~~~~
2025-05-01 10:26:20 -07:00
git
17e63f90ca Update default gems list at b63c4d14f2 [ci skip] 2025-05-01 16:35:17 +00:00
Aaron Patterson
b63c4d14f2 [ruby/psych] Bump version for release
bb63f91825
2025-05-01 16:34:09 +00:00
Burdette Lamar
79fe8aa010
[DOC] Tweaks for String.new 2025-05-01 10:51:22 -04:00
Yusuke Endoh
5cee3329df Skip test affected by TracePoint-dependent allocation_class_path
These assertions fail when TracePoint is enabled due to differing
allocation context. Commented out for now until behavior is fixed.

See [Bug #21298]
2025-05-01 17:21:36 +09:00
Jean Boussier
de6e59e5ba Sync ruby/json
Fix: https://github.com/ruby/json/issues/796
2025-05-01 10:06:04 +02:00
Yusuke Endoh
e8ad728209 Omit tests using ISeq#to_binary under coverage measurement
... because ISeq#to_binary does not work
2025-05-01 14:15:55 +09:00
Yusuke Endoh
1c89b1ec60 Reset GC.stress to avoid slow coverage processing during process exit 2025-05-01 14:08:33 +09:00
Hiroshi SHIBATA
994dadfbf4 Removed unused OS_VER variable 2025-05-01 10:46:00 +09:00
Hiroshi SHIBATA
17912cb500 windows-2019 will be EOL at end of June, 2025 2025-05-01 10:46:00 +09:00
Max Bernstein
5411b504a5
ZJIT: Use RefCell to allow path compression in union-find (#13218)
Use RefCell to allow path compression in union-find

When I wrote the original version I didn't understand the interior
mutability pattern, but now I do! With this commit, we should have a
more optimal union-find implementation.
2025-04-30 16:28:22 -07:00
John Hawthorn
7866e124a8 Use rb_current_ec_noinline in assertions
When doing a coroutine transfer from one thread to another, there's a
risk that the compiler will reuse an address from TLS before the
transfer to the new thread.

These VM assertions are all in places we would not otherwise be reading
from TLS, but using the value of `ec` or `cr` passed in. Switching these
to test against rb_current_ec_noinline() instead ensures there isn't an
optimization applied to how we read ruby_current_ec.

Currently it seems we were hitting this on LLVM 18 specifically, but I
don't know of any reason other versions wouldn't have the same issue.
2025-04-30 15:36:58 -07:00
Max Bernstein
73fdd90315
ZJIT: Compile opt_new to slow-path SendWithoutBlock (#13216) 2025-04-30 14:48:12 -07:00
Jean Boussier
c65991978b get_next_shape_internal: Skip VM lock for single child case
If the shape has only one child, we check it lock-free without
compromising thread safety.

I haven't computed hard data as to how often that it the case,
but we can assume that it's not too rare for shapes to have
a single child that is often requested, typically when freezing
and object.
2025-04-30 23:32:33 +02:00
Jean Boussier
f55138c9e7 [ruby/psych] Handle Ruby 3.5 new Set class
Since `Set` no longer is a regular object class holding a Hash
it needs to be specially handled.

c2d185d27c
2025-04-30 18:31:33 +00:00
Matt Valentine-House
46c9e46ef6 [ruby/mmtk] Exclude the test_ractor_parallel test with MMTk
86b0dbeca8
2025-04-30 13:41:21 +00:00
Matt Valentine-House
59a902cd79 [ruby/mmtk] test_finalize is in TestObjectSpace not TestObjSpace
These filenames are passed into test classes, and the tests we're trying
to exclude exist in TestObjectSpace in the Ruby repo, not TestObjSpace

195728dc8c
2025-04-30 13:41:21 +00:00
Nobuyoshi Nakada
b42afa1dbc
Suppress gcc 15 unterminated-string-initialization warnings 2025-04-30 20:04:10 +09:00
Alan Wu
545aafa2a2
ZJIT: Add make zjit-test-lldb [ci skip]
Handy for dropping into LLDB for a Rust test.
2025-04-30 19:49:54 +09:00
Alan Wu
719486a642 Fix C23 (GCC 15) WIN32 compatibility for rb_define_* functions
Fixes [Bug #21286]
2025-04-30 19:44:59 +09:00
Hiroshi SHIBATA
39ba16e5a1 Re-enabled repl_type_completor test with upstream fix
https://github.com/ruby/repl_type_completor/pull/62
2025-04-30 16:59:25 +09:00
Hiroshi SHIBATA
8b4017584b Use EnvUtil.apply_timeout_scale for test_io_wait.rb 2025-04-30 16:59:16 +09:00
git
142998fdaa Update bundled gems list as of 2025-04-30 2025-04-30 07:04:02 +00:00
git
d046c0a471 Update default gems list at 6e7825316e [ci skip] 2025-04-30 06:13:46 +00:00
Jean Boussier
6e7825316e [ruby/json] Remove explicit include of extconf.h
6b059900de

.
2025-04-30 08:12:41 +02:00
Jean Boussier
6ba0dc4d97 [ruby/json] Fix --with-static-linked-ext builds
d7d60cccb0
2025-04-30 08:12:41 +02:00
Jean Boussier
338adad8ba [ruby/json] Fix i686 builds
We should test compilation with `-msse2` because we need to
test with whatever arguments Ruby will be compiled with.

0a871365db
2025-04-30 08:12:41 +02:00
Jean Boussier
b5beed45a2 [ruby/json] SIMD: Match control char and double quote in one pass
`c < 32 || c == 34` is equivalent to `c ^ 2 < 33`.

Found in: https://lemire.me/blog/2025/04/13/detect-control-characters-quotes-and-backslashes-efficiently-using-swar/

The gain seem mostly present on micro-benchmark, and even there aren't
very consistent, but it's never slower.

```
== Encoding long string (124001 bytes)
ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +YJIT +PRISM [arm64-darwin24]
Warming up --------------------------------------
               after     5.295k i/100ms
Calculating -------------------------------------
               after     55.796k (± 3.4%) i/s   (17.92 μs/i) -    280.635k in   5.035690s

Comparison:
              before:    49840.7 i/s
               after:    55795.8 i/s - 1.12x  faster
```

034c5debd8
2025-04-30 08:12:41 +02:00
Jean Boussier
b7d1e33f26 Update ext/json/generator/depend 2025-04-30 08:12:41 +02:00
Scott Myron
a3ec53bbb0 [ruby/json] Introduce ARM Neon and SSE2 SIMD.
(https://github.com/ruby/json/pull/743)

See the pull request for the long development history: https://github.com/ruby/json/pull/743

```
== Encoding activitypub.json (52595 bytes)
ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +YJIT +PRISM [arm64-darwin24]
Warming up --------------------------------------
               after     2.913k i/100ms
Calculating -------------------------------------
               after     29.377k (± 2.0%) i/s   (34.04 μs/i) -    148.563k in   5.059169s

Comparison:
              before:    23314.1 i/s
               after:    29377.3 i/s - 1.26x  faster

== Encoding citm_catalog.json (500298 bytes)
ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +YJIT +PRISM [arm64-darwin24]
Warming up --------------------------------------
               after   152.000 i/100ms
Calculating -------------------------------------
               after      1.569k (± 0.8%) i/s  (637.49 μs/i) -      7.904k in   5.039001s

Comparison:
              before:     1485.6 i/s
               after:     1568.7 i/s - 1.06x  faster

== Encoding twitter.json (466906 bytes)
ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +YJIT +PRISM [arm64-darwin24]
Warming up --------------------------------------
               after   309.000 i/100ms
Calculating -------------------------------------
               after      3.115k (± 3.1%) i/s  (321.01 μs/i) -     15.759k in   5.063776s

Comparison:
              before:     2508.3 i/s
               after:     3115.2 i/s - 1.24x  faster
```

49003523da
2025-04-30 08:12:41 +02:00
Jean Boussier
7f0c6d30d3 [ruby/json] Use RB_TYPE_P
b14250f1da
2025-04-30 08:12:41 +02:00