diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 5fb9ba5f7dd3ac..3ca28ad72c8917 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -36,3 +36,5 @@ a0f7de814ae5c299d6ce99bed5fb308a05d50ba0 d4e24021d39e1f80f0055b55d91f8d5f22e15084 7a56c316418980b8a41fcbdc94067b2bda2ad112 e90282be7ba1bc8e3119f6e1a2c80356ceb3f80a +26a9e0b4e31f7b5a9cbd755e0a15823a8fa51bae +2f53985da9ee593fe524d408256835667938c7d7 diff --git a/.github/workflows/zjit-ubuntu.yml b/.github/workflows/zjit-ubuntu.yml index 040187fca3baf7..7778c449e8e8ea 100644 --- a/.github/workflows/zjit-ubuntu.yml +++ b/.github/workflows/zjit-ubuntu.yml @@ -61,6 +61,12 @@ jobs: specopts: '-T --zjit-disable-hir-opt -T --zjit-call-threshold=1' configure: '--enable-zjit=dev' + # The optimizer benefits from at least 1 iteration of profiling. Also, many + # regression tests in bootstraptest/test_yjit.rb assume call-threshold=2. + - test_task: 'btest' + run_opts: '--zjit-call-threshold=2' + configure: '--enable-zjit=dev' + - test_task: 'zjit-check' # zjit-test + quick feedback of test_zjit.rb configure: '--enable-yjit --enable-zjit=dev' rust_version: '1.85.0' diff --git a/.rdoc_options b/.rdoc_options index b8b511efe67f1e..38dca221112c53 100644 --- a/.rdoc_options +++ b/.rdoc_options @@ -11,7 +11,10 @@ rdoc_include: exclude: - \.gemspec\z +generator_name: aliki + autolink_excluded_words: +- Box - Class - Method - Module @@ -23,3 +26,15 @@ autolink_excluded_words: - YJIT canonical_root: https://docs.ruby-lang.org/en/master + +footer_content: + Ruby: + Documentation: index.html + Official Website: https://www.ruby-lang.org/ + Playground: https://ruby.github.io/play-ruby/ + Resources: + GitHub: https://github.com/ruby/ruby + Issue Tracker: https://bugs.ruby-lang.org/projects/ruby-master/issues + RubyGems: https://rubygems.org/ + Community: + X: https://x.com/rubylangorg diff --git a/NEWS.md b/NEWS.md index 9d47bb774ef626..fbbc06713438cd 100644 --- a/NEWS.md +++ b/NEWS.md @@ -167,7 +167,7 @@ The following bundled gems are promoted from default gems. * pstore 0.2.0 * benchmark 0.5.0 * logger 1.7.0 -* rdoc 6.15.1 +* rdoc 6.16.0 * win32ole 1.9.2 * irb 1.15.3 * reline 0.6.3 @@ -221,7 +221,7 @@ The following bundled gems are updated. * minitest 5.26.2 * power_assert 3.0.1 * rake 13.3.1 -* test-unit 3.7.1 +* test-unit 3.7.3 * rexml 3.4.4 * net-ftp 0.3.9 * net-imap 0.5.12 diff --git a/configure.ac b/configure.ac index 9120fc25ecddf4..22baeabb32ab46 100644 --- a/configure.ac +++ b/configure.ac @@ -1749,8 +1749,10 @@ AS_IF([test "$GCC" = yes], [ for lib in "" atomic; do AS_IF([test "$lib" != ""], [ AC_CHECK_LIB([atomic], [__atomic_fetch_add_8]) + unset rb_cv_gcc_atomic_builtins_64 ]) - AC_CACHE_CHECK([for 64bit __atomic builtins], [rb_cv_gcc_atomic_builtins_64], [ + AC_CACHE_CHECK([for 64bit __atomic builtins${lib:+ with -l$lib}], + [rb_cv_gcc_atomic_builtins_64], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@include uint64_t atomic_var;]], [[ diff --git a/gems/bundled_gems b/gems/bundled_gems index 2d5c6bdaa1cea1..e1e6b01bfdda10 100644 --- a/gems/bundled_gems +++ b/gems/bundled_gems @@ -9,7 +9,7 @@ minitest 5.26.2 https://github.com/minitest/minitest power_assert 3.0.1 https://github.com/ruby/power_assert rake 13.3.1 https://github.com/ruby/rake -test-unit 3.7.1 https://github.com/test-unit/test-unit +test-unit 3.7.3 https://github.com/test-unit/test-unit rexml 3.4.4 https://github.com/ruby/rexml rss 0.3.1 https://github.com/ruby/rss net-ftp 0.3.9 https://github.com/ruby/net-ftp @@ -39,7 +39,7 @@ ostruct 0.6.3 https://github.com/ruby/ostruct pstore 0.2.0 https://github.com/ruby/pstore benchmark 0.5.0 https://github.com/ruby/benchmark logger 1.7.0 https://github.com/ruby/logger -rdoc 6.15.1 https://github.com/ruby/rdoc +rdoc 6.16.0 https://github.com/ruby/rdoc win32ole 1.9.2 https://github.com/ruby/win32ole irb 1.15.3 https://github.com/ruby/irb reline 0.6.3 https://github.com/ruby/reline diff --git a/imemo.c b/imemo.c index d83c690ba5ae81..8ec58ae4a92e52 100644 --- a/imemo.c +++ b/imemo.c @@ -426,6 +426,13 @@ rb_imemo_mark_and_move(VALUE obj, bool reference_updating) rb_gc_mark_and_move_ptr(&env->iseq); + if (VM_ENV_LOCAL_P(env->ep) && VM_ENV_BOXED_P(env->ep)) { + const rb_box_t *box = VM_ENV_BOX(env->ep); + if (BOX_USER_P(box)) { + rb_gc_mark_and_move((VALUE *)&box->box_object); + } + } + if (reference_updating) { ((VALUE *)env->ep)[VM_ENV_DATA_INDEX_ENV] = rb_gc_location(env->ep[VM_ENV_DATA_INDEX_ENV]); } diff --git a/test/cgi/test_cgi_escape.rb b/test/cgi/test_cgi_escape.rb index f6ca658934cdec..73d99e8aacda39 100644 --- a/test/cgi/test_cgi_escape.rb +++ b/test/cgi/test_cgi_escape.rb @@ -300,7 +300,7 @@ def setup remove_method :escapeHTML alias _unescapeHTML unescapeHTML remove_method :unescapeHTML - end if defined?(CGI::EscapeExt) + end if defined?(CGI::EscapeExt) and CGI::EscapeExt.method_defined?(:escapeHTML) end def teardown @@ -309,7 +309,7 @@ def teardown remove_method :_escapeHTML alias unescapeHTML _unescapeHTML remove_method :_unescapeHTML - end if defined?(CGI::EscapeExt) + end if defined?(CGI::EscapeExt) and CGI::EscapeExt.method_defined?(:_escapeHTML) end include CGIEscapeTest::UnescapeHTMLTests diff --git a/test/ruby/test_box.rb b/test/ruby/test_box.rb index 9b87f9b5bc458a..7023ecab16aa0e 100644 --- a/test/ruby/test_box.rb +++ b/test/ruby/test_box.rb @@ -810,4 +810,21 @@ def test_loading_extension_libs_in_main_box assert_equal expected, 1 end; end + + def test_mark_box_object_referred_only_from_binding + assert_separately([ENV_ENABLE_BOX], __FILE__, __LINE__, "#{<<~"begin;"}\n#{<<~'end;'}", ignore_stderr: true) + begin; + box = Ruby::Box.new + box.eval('class Integer; def +(*)=42; end') + b = box.eval('binding') + box = nil # remove direct reference to the box + + assert_equal 42, b.eval('1+2') + + GC.stress = true + GC.start + + assert_equal 42, b.eval('1+2') + end; + end end diff --git a/vm.c b/vm.c index fd8c923649cb65..f9c615c3e23c30 100644 --- a/vm.c +++ b/vm.c @@ -3677,6 +3677,13 @@ rb_execution_context_mark(const rb_execution_context_t *ec) rb_gc_mark_movable((VALUE)cfp->iseq); rb_gc_mark_movable((VALUE)cfp->block_code); + if (VM_ENV_LOCAL_P(ep) && VM_ENV_BOXED_P(ep)) { + const rb_box_t *box = VM_ENV_BOX(ep); + if (BOX_USER_P(box)) { + rb_gc_mark_movable(box->box_object); + } + } + if (!VM_ENV_LOCAL_P(ep)) { const VALUE *prev_ep = VM_ENV_PREV_EP(ep); if (VM_ENV_FLAGS(prev_ep, VM_ENV_FLAG_ESCAPED)) {