Skip to content

Commit ba673ea

Browse files
committed
Merge remote-tracking branch 'upstream/master' into Ractor-Local-GC-version-3
2 parents 6d9c0eb + 7866e12 commit ba673ea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2046
-657
lines changed

.github/auto_request_review.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
files:
2-
'yjit*': [team:yjit]
3-
'yjit/**/*': [team:yjit]
2+
'yjit*': [team:jit]
3+
'yjit/**/*': [team:jit]
44
'yjit/src/cruby_bindings.inc.rs': []
5-
'doc/yjit/*': [team:yjit]
6-
'bootstraptest/test_yjit*': [team:yjit]
7-
'test/ruby/test_yjit*': [team:yjit]
8-
'zjit*': [team:yjit]
9-
'zjit/**/*': [team:yjit]
5+
'doc/yjit/*': [team:jit]
6+
'bootstraptest/test_yjit*': [team:jit]
7+
'test/ruby/test_yjit*': [team:jit]
8+
'zjit*': [team:jit]
9+
'zjit/**/*': [team:jit]
1010
'zjit/src/cruby_bindings.inc.rs': []
11-
'doc/zjit*': [team:yjit]
12-
'test/ruby/test_zjit*': [team:yjit]
11+
'doc/zjit*': [team:jit]
12+
'test/ruby/test_zjit*': [team:jit]
1313
options:
1414
ignore_draft: true
1515
# This currently doesn't work as intended. We want to skip reviews when only
1616
# cruby_bingings.inc.rs is modified, but this skips reviews even when other
17-
# yjit files are modified as well. To be enabled after fixing the behavior.
17+
# files are modified as well. To be enabled after fixing the behavior.
1818
#last_files_match_only: true

.github/workflows/compilers.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ jobs:
8686
optflags: '-O2'
8787
enable_shared: false
8888
- { uses: './.github/actions/compilers', name: 'ext/Setup', with: { static_exts: 'etc json/* */escape' } }
89+
- { uses: './.github/actions/compilers', name: 'GCC 15', with: { tag: 'gcc-15' } }
8990
- { uses: './.github/actions/compilers', name: 'GCC 14', with: { tag: 'gcc-14' } }
9091
- { uses: './.github/actions/compilers', name: 'GCC 13', with: { tag: 'gcc-13' } }
9192
- { uses: './.github/actions/compilers', name: 'GCC 12', with: { tag: 'gcc-12' } }
@@ -193,7 +194,9 @@ jobs:
193194
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
194195
with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github }
195196
- { uses: './.github/actions/setup/directories', with: { srcdir: 'src', builddir: 'build', makeup: true, fetch-depth: 10 } }
196-
- { uses: './.github/actions/compilers', name: 'disable-jit', with: { append_configure: '--disable-yjit' } }
197+
- { uses: './.github/actions/compilers', name: 'disable-jit', with: { append_configure: '--disable-yjit --disable-zjit' } }
198+
- { uses: './.github/actions/compilers', name: 'disable-yjit', with: { append_configure: '--disable-yjit' } }
199+
- { uses: './.github/actions/compilers', name: 'disable-zjit', with: { append_configure: '--disable-zjit' } }
197200
- { uses: './.github/actions/compilers', name: 'disable-dln', with: { append_configure: '--disable-dln' } }
198201
- { uses: './.github/actions/compilers', name: 'enable-mkmf-verbose', with: { append_configure: '--enable-mkmf-verbose' } }
199202
- { uses: './.github/actions/compilers', name: 'disable-rubygems', with: { append_configure: '--disable-rubygems' } }

NEWS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ The following default gems are updated.
6363
* RubyGems 3.7.0.dev
6464
* bundler 2.7.0.dev
6565
* cgi 0.4.2
66-
* json 2.11.2
66+
* json 2.11.3
6767
* optparse 0.7.0.dev.2
6868
* prism 1.4.0
6969
* psych 5.2.3
@@ -79,7 +79,7 @@ The following bundled gems are updated.
7979
* minitest 5.25.5
8080
* test-unit 3.6.8
8181
* rexml 3.4.1
82-
* net-imap 0.5.7
82+
* net-imap 0.5.8
8383
* net-smtp 0.5.1
8484
* rbs 3.9.2
8585
* bigdecimal 3.1.9

bootstraptest/test_yjit.rb

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3667,6 +3667,74 @@ def foo
36673667
test
36683668
}
36693669

3670+
# Bug #21257 (infinite jmp)
3671+
assert_equal 'ok', %q{
3672+
Good = :ok
3673+
3674+
def first
3675+
second
3676+
end
3677+
3678+
def second
3679+
::Good
3680+
end
3681+
3682+
# Make `second` side exit on its first instruction
3683+
trace = TracePoint.new(:line) { }
3684+
trace.enable(target: method(:second))
3685+
3686+
first
3687+
# Recompile now that the constant cache is populated, so we get a fallthrough from `first` to `second`
3688+
# (this is need to reproduce with --yjit-call-threshold=1)
3689+
RubyVM::YJIT.code_gc if defined?(RubyVM::YJIT)
3690+
first
3691+
3692+
# Trigger a constant cache miss in rb_vm_opt_getconstant_path (in `second`) next time it's called
3693+
module InvalidateConstantCache
3694+
Good = nil
3695+
end
3696+
3697+
RubyVM::YJIT.simulate_oom! if defined?(RubyVM::YJIT)
3698+
3699+
first
3700+
first
3701+
}
3702+
3703+
assert_equal 'ok', %q{
3704+
# Multiple incoming branches into second
3705+
Good = :ok
3706+
3707+
def incoming_one
3708+
second
3709+
end
3710+
3711+
def incoming_two
3712+
second
3713+
end
3714+
3715+
def second
3716+
::Good
3717+
end
3718+
3719+
# Make `second` side exit on its first instruction
3720+
trace = TracePoint.new(:line) { }
3721+
trace.enable(target: method(:second))
3722+
3723+
incoming_one
3724+
# Recompile now that the constant cache is populated, so we get a fallthrough from `incoming_one` to `second`
3725+
# (this is need to reproduce with --yjit-call-threshold=1)
3726+
RubyVM::YJIT.code_gc if defined?(RubyVM::YJIT)
3727+
incoming_one
3728+
incoming_two
3729+
3730+
# Trigger a constant cache miss in rb_vm_opt_getconstant_path (in `second`) next time it's called
3731+
module InvalidateConstantCache
3732+
Good = nil
3733+
end
3734+
3735+
incoming_one
3736+
}
3737+
36703738
assert_equal 'ok', %q{
36713739
# Try to compile new method while OOM
36723740
def foo

common.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9993,6 +9993,7 @@ marshal.$(OBJEXT): {$(VPATH)}internal/attr/nodiscard.h
99939993
marshal.$(OBJEXT): {$(VPATH)}internal/attr/noexcept.h
99949994
marshal.$(OBJEXT): {$(VPATH)}internal/attr/noinline.h
99959995
marshal.$(OBJEXT): {$(VPATH)}internal/attr/nonnull.h
9996+
marshal.$(OBJEXT): {$(VPATH)}internal/attr/nonstring.h
99969997
marshal.$(OBJEXT): {$(VPATH)}internal/attr/noreturn.h
99979998
marshal.$(OBJEXT): {$(VPATH)}internal/attr/packed_struct.h
99989999
marshal.$(OBJEXT): {$(VPATH)}internal/attr/pure.h
@@ -10614,6 +10615,7 @@ miniinit.$(OBJEXT): {$(VPATH)}internal/attr/nodiscard.h
1061410615
miniinit.$(OBJEXT): {$(VPATH)}internal/attr/noexcept.h
1061510616
miniinit.$(OBJEXT): {$(VPATH)}internal/attr/noinline.h
1061610617
miniinit.$(OBJEXT): {$(VPATH)}internal/attr/nonnull.h
10618+
miniinit.$(OBJEXT): {$(VPATH)}internal/attr/nonstring.h
1061710619
miniinit.$(OBJEXT): {$(VPATH)}internal/attr/noreturn.h
1061810620
miniinit.$(OBJEXT): {$(VPATH)}internal/attr/packed_struct.h
1061910621
miniinit.$(OBJEXT): {$(VPATH)}internal/attr/pure.h
@@ -16938,6 +16940,7 @@ signal.$(OBJEXT): {$(VPATH)}internal/attr/nodiscard.h
1693816940
signal.$(OBJEXT): {$(VPATH)}internal/attr/noexcept.h
1693916941
signal.$(OBJEXT): {$(VPATH)}internal/attr/noinline.h
1694016942
signal.$(OBJEXT): {$(VPATH)}internal/attr/nonnull.h
16943+
signal.$(OBJEXT): {$(VPATH)}internal/attr/nonstring.h
1694116944
signal.$(OBJEXT): {$(VPATH)}internal/attr/noreturn.h
1694216945
signal.$(OBJEXT): {$(VPATH)}internal/attr/packed_struct.h
1694316946
signal.$(OBJEXT): {$(VPATH)}internal/attr/pure.h
@@ -17706,6 +17709,7 @@ string.$(OBJEXT): {$(VPATH)}internal/attr/nodiscard.h
1770617709
string.$(OBJEXT): {$(VPATH)}internal/attr/noexcept.h
1770717710
string.$(OBJEXT): {$(VPATH)}internal/attr/noinline.h
1770817711
string.$(OBJEXT): {$(VPATH)}internal/attr/nonnull.h
17712+
string.$(OBJEXT): {$(VPATH)}internal/attr/nonstring.h
1770917713
string.$(OBJEXT): {$(VPATH)}internal/attr/noreturn.h
1771017714
string.$(OBJEXT): {$(VPATH)}internal/attr/packed_struct.h
1771117715
string.$(OBJEXT): {$(VPATH)}internal/attr/pure.h
@@ -18171,6 +18175,7 @@ symbol.$(OBJEXT): {$(VPATH)}internal/attr/nodiscard.h
1817118175
symbol.$(OBJEXT): {$(VPATH)}internal/attr/noexcept.h
1817218176
symbol.$(OBJEXT): {$(VPATH)}internal/attr/noinline.h
1817318177
symbol.$(OBJEXT): {$(VPATH)}internal/attr/nonnull.h
18178+
symbol.$(OBJEXT): {$(VPATH)}internal/attr/nonstring.h
1817418179
symbol.$(OBJEXT): {$(VPATH)}internal/attr/noreturn.h
1817518180
symbol.$(OBJEXT): {$(VPATH)}internal/attr/packed_struct.h
1817618181
symbol.$(OBJEXT): {$(VPATH)}internal/attr/pure.h

enc/depend

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7016,6 +7016,7 @@ enc/trans/iso2022.$(OBJEXT): internal/attr/nodiscard.h
70167016
enc/trans/iso2022.$(OBJEXT): internal/attr/noexcept.h
70177017
enc/trans/iso2022.$(OBJEXT): internal/attr/noinline.h
70187018
enc/trans/iso2022.$(OBJEXT): internal/attr/nonnull.h
7019+
enc/trans/iso2022.$(OBJEXT): internal/attr/nonstring.h
70197020
enc/trans/iso2022.$(OBJEXT): internal/attr/noreturn.h
70207021
enc/trans/iso2022.$(OBJEXT): internal/attr/packed_struct.h
70217022
enc/trans/iso2022.$(OBJEXT): internal/attr/pure.h

enc/trans/iso2022.trans

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "transcode_data.h"
2+
#include "ruby/internal/attr/nonstring.h"
23

34
<%
45
map = {
@@ -436,7 +437,7 @@ rb_cp50221_encoder = {
436437

437438
/* JIS0201 to JIS0208 conversion table */
438439
enum {tbl0208_num = 0xDF - 0xA1 + 1};
439-
static const char tbl0208[tbl0208_num][2] = {
440+
RBIMPL_ATTR_NONSTRING() static const char tbl0208[tbl0208_num][2] = {
440441
"\x21\x23", "\x21\x56", "\x21\x57", "\x21\x22",
441442
"\x21\x26", "\x25\x72", "\x25\x21", "\x25\x23",
442443
"\x25\x25", "\x25\x27", "\x25\x29", "\x25\x63",

ext/json/generator/depend

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,4 +180,5 @@ generator.o: $(srcdir)/../fbuffer/fbuffer.h
180180
generator.o: $(srcdir)/../vendor/fpconv.c
181181
generator.o: $(srcdir)/../vendor/jeaiii-ltoa.h
182182
generator.o: generator.c
183+
generator.o: simd.h
183184
# AUTOGENERATED DEPENDENCIES END

ext/json/generator/extconf.rb

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,34 @@
66
else
77
append_cflags("-std=c99")
88
$defs << "-DJSON_GENERATOR"
9+
10+
if enable_config('generator-use-simd', default=!ENV["JSON_DISABLE_SIMD"])
11+
if RbConfig::CONFIG['host_cpu'] =~ /^(arm.*|aarch64.*)/
12+
# Try to compile a small program using NEON instructions
13+
if have_header('arm_neon.h')
14+
have_type('uint8x16_t', headers=['arm_neon.h']) && try_compile(<<~'SRC')
15+
#include <arm_neon.h>
16+
int main() {
17+
uint8x16_t test = vdupq_n_u8(32);
18+
return 0;
19+
}
20+
SRC
21+
$defs.push("-DENABLE_SIMD")
22+
end
23+
end
24+
25+
if have_header('x86intrin.h') && have_type('__m128i', headers=['x86intrin.h']) && try_compile(<<~'SRC')
26+
#include <x86intrin.h>
27+
int main() {
28+
__m128i test = _mm_set1_epi8(32);
29+
return 0;
30+
}
31+
SRC
32+
$defs.push("-DENABLE_SIMD")
33+
end
34+
35+
have_header('cpuid.h')
36+
end
37+
938
create_makefile 'json/ext/generator'
1039
end

0 commit comments

Comments
 (0)