diff --git a/NEWS.md b/NEWS.md index a4abd2bdbc7afe..991f34965fe1fc 100644 --- a/NEWS.md +++ b/NEWS.md @@ -296,8 +296,8 @@ The following bundled gems are promoted from default gems. * 0.4.0 to [v0.4.1][benchmark-v0.4.1], [v0.5.0][benchmark-v0.5.0] * logger 1.7.0 * 1.6.4 to [v1.6.5][logger-v1.6.5], [v1.6.6][logger-v1.6.6], [v1.7.0][logger-v1.7.0] -* rdoc 7.0.2 - * 6.14.0 to [v6.14.1][rdoc-v6.14.1], [v6.14.2][rdoc-v6.14.2], [v6.15.0][rdoc-v6.15.0], [v6.15.1][rdoc-v6.15.1], [v6.16.0][rdoc-v6.16.0], [v6.16.1][rdoc-v6.16.1], [v6.17.0][rdoc-v6.17.0], [v7.0.0][rdoc-v7.0.0], [v7.0.1][rdoc-v7.0.1], [v7.0.2][rdoc-v7.0.2] +* rdoc 7.0.3 + * 6.14.0 to [v6.14.1][rdoc-v6.14.1], [v6.14.2][rdoc-v6.14.2], [v6.15.0][rdoc-v6.15.0], [v6.15.1][rdoc-v6.15.1], [v6.16.0][rdoc-v6.16.0], [v6.16.1][rdoc-v6.16.1], [v6.17.0][rdoc-v6.17.0], [v7.0.0][rdoc-v7.0.0], [v7.0.1][rdoc-v7.0.1], [v7.0.2][rdoc-v7.0.2], [v7.0.3][rdoc-v7.0.3] * win32ole 1.9.2 * 1.9.1 to [v1.9.2][win32ole-v1.9.2] * irb 1.16.0 @@ -373,13 +373,13 @@ The following default gems are updated. The following bundled gems are updated. -* minitest 6.0.0 +* minitest 5.27.0 * power_assert 3.0.1 * 2.0.5 to [v3.0.0][power_assert-v3.0.0], [v3.0.1][power_assert-v3.0.1] * rake 13.3.1 * 13.2.1 to [v13.3.0][rake-v13.3.0], [v13.3.1][rake-v13.3.1] -* test-unit 3.7.3 - * 3.6.7 to [3.6.8][test-unit-3.6.8], [3.6.9][test-unit-3.6.9], [3.7.0][test-unit-3.7.0], [3.7.1][test-unit-3.7.1], [3.7.2][test-unit-3.7.2], [3.7.3][test-unit-3.7.3] +* test-unit 3.7.5 + * 3.6.7 to [3.6.8][test-unit-3.6.8], [3.6.9][test-unit-3.6.9], [3.7.0][test-unit-3.7.0], [3.7.1][test-unit-3.7.1], [3.7.2][test-unit-3.7.2], [3.7.3][test-unit-3.7.3], [3.7.4][test-unit-3.7.4], [3.7.5][test-unit-3.7.5] * rexml 3.4.4 * rss 0.3.2 * 0.3.1 to [0.3.2][rss-0.3.2] @@ -570,7 +570,8 @@ A lot of work has gone into making Ractors more stable, performant, and usable. * ZJIT * Introduce an [experimental method-based JIT compiler](https://docs.ruby-lang.org/en/master/jit/zjit_md.html). - To enable ZJIT on supported platforms, supply the `--zjit` option or call `RubyVM::ZJIT.enable` at runtime. + Where available, ZJIT can be enabled at runtime with the `--zjit` option or by calling `RubyVM::ZJIT.enable`. + When building Ruby, Rust 1.85.0 or later is required to include ZJIT support. * As of Ruby 4.0.0, ZJIT is faster than the interpreter, but not yet as fast as YJIT. We encourage experimentation with ZJIT, but advise against deploying it in production for now. * Our goal is to make ZJIT faster than YJIT and production-ready in Ruby 4.1. @@ -652,6 +653,7 @@ A lot of work has gone into making Ractors more stable, performant, and usable. [rdoc-v7.0.0]: https://github.com/ruby/rdoc/releases/tag/v7.0.0 [rdoc-v7.0.1]: https://github.com/ruby/rdoc/releases/tag/v7.0.1 [rdoc-v7.0.2]: https://github.com/ruby/rdoc/releases/tag/v7.0.2 +[rdoc-v7.0.3]: https://github.com/ruby/rdoc/releases/tag/v7.0.3 [win32ole-v1.9.2]: https://github.com/ruby/win32ole/releases/tag/v1.9.2 [irb-v1.15.0]: https://github.com/ruby/irb/releases/tag/v1.15.0 [irb-v1.15.1]: https://github.com/ruby/irb/releases/tag/v1.15.1 @@ -755,6 +757,8 @@ A lot of work has gone into making Ractors more stable, performant, and usable. [test-unit-3.7.1]: https://github.com/test-unit/test-unit/releases/tag/3.7.1 [test-unit-3.7.2]: https://github.com/test-unit/test-unit/releases/tag/3.7.2 [test-unit-3.7.3]: https://github.com/test-unit/test-unit/releases/tag/3.7.3 +[test-unit-3.7.4]: https://github.com/test-unit/test-unit/releases/tag/3.7.4 +[test-unit-3.7.5]: https://github.com/test-unit/test-unit/releases/tag/3.7.5 [rss-0.3.2]: https://github.com/ruby/rss/releases/tag/0.3.2 [net-ftp-v0.3.9]: https://github.com/ruby/net-ftp/releases/tag/v0.3.9 [net-imap-v0.5.9]: https://github.com/ruby/net-imap/releases/tag/v0.5.9 diff --git a/doc/language/options.md b/doc/language/options.md index c805c7dd65c2c0..cca87f42dedf0f 100644 --- a/doc/language/options.md +++ b/doc/language/options.md @@ -1,10 +1,3 @@ - - # Ruby Command-Line Options ## About the Examples diff --git a/gems/bundled_gems b/gems/bundled_gems index 495f7afc694e0d..82dffd091e9edb 100644 --- a/gems/bundled_gems +++ b/gems/bundled_gems @@ -6,10 +6,10 @@ # - revision: revision in repository-url to test # if `revision` is not given, "v"+`version` or `version` will be used. -minitest 6.0.0 https://github.com/minitest/minitest +minitest 5.27.0 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.3 https://github.com/test-unit/test-unit +test-unit 3.7.5 https://github.com/test-unit/test-unit rexml 3.4.4 https://github.com/ruby/rexml rss 0.3.2 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 7.0.2 https://github.com/ruby/rdoc +rdoc 7.0.3 https://github.com/ruby/rdoc win32ole 1.9.2 https://github.com/ruby/win32ole irb 1.16.0 https://github.com/ruby/irb reline 0.6.3 https://github.com/ruby/reline diff --git a/ruby.c b/ruby.c index 11376cbe7066a9..b00fc1502dec1c 100644 --- a/ruby.c +++ b/ruby.c @@ -410,9 +410,6 @@ usage(const char *name, int help, int highlight, int columns) #define SHOW(m) show_usage_line(&(m), help, highlight, w, columns) printf("%sUsage:%s %s [options] [--] [filepath] [arguments]\n", sb, se, name); - printf("\n""Details and examples at https://docs.ruby-lang.org/en/%s/ruby/options_md.html\n", - ruby_api_version_name); - for (i = 0; i < num; ++i) SHOW(usage_msg[i]); diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index 2ec6478a7fd058..735d2681fb6a13 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -47,15 +47,10 @@ def test_source_file assert_in_out_err([], "", [], []) end - version = RUBY_PATCHLEVEL == -1 ? "master" : "#{RUBY_VERSION_MAJOR}.#{RUBY_VERSION_MINOR}" - OPTIONS_LINK = "https://docs.ruby-lang.org/en/#{version}/ruby/options_md.html" - def test_usage assert_in_out_err(%w(-h)) do |r, e| - _, _, link, *r = r - assert_include(link, OPTIONS_LINK) - assert_operator(r.size, :<=, 24) - longer = r.select {|x| x.size >= 80} + assert_operator(r.size, :<=, 25) + longer = r[1..-1].select {|x| x.size >= 80} assert_equal([], longer) assert_equal([], e) end @@ -63,9 +58,7 @@ def test_usage def test_usage_long assert_in_out_err(%w(--help)) do |r, e| - _, _, link, *r = r - assert_include(link, OPTIONS_LINK) - longer = r.select {|x| x.size > 80} + longer = r[1..-1].select {|x| x.size > 80} assert_equal([], longer) assert_equal([], e) end diff --git a/test/rubygems/test_gem_commands_update_command.rb b/test/rubygems/test_gem_commands_update_command.rb index 3bb4a72c4151ad..5ed12ad4814095 100644 --- a/test/rubygems/test_gem_commands_update_command.rb +++ b/test/rubygems/test_gem_commands_update_command.rb @@ -722,7 +722,7 @@ def test_pass_down_the_job_option_to_make gem_make_out = File.read(File.join(gemspec.extension_dir, "gem_make.out")) if vc_windows? && nmake_found? - refute_includes(gem_make_out, "-j2") + refute_includes(gem_make_out, " -j2") else assert_includes(gem_make_out, "make -j2") end diff --git a/tool/rbs_skip_tests_windows b/tool/rbs_skip_tests_windows index 43888c98a71324..1b9f930e846624 100644 --- a/tool/rbs_skip_tests_windows +++ b/tool/rbs_skip_tests_windows @@ -105,3 +105,5 @@ test_new(TempfileSingletonTest) # Errno::EACCES: Permission denied @ apply2files - C:/a/_temp/d20250813-10156-f8z9pn/test.gz test_open(ZlibGzipReaderSingletonTest) + +test_reachable_objects_from_root(ObjectSpaceTest) To avoid NoMemoryError with test-unit 3.7.5 diff --git a/zjit/src/hir.rs b/zjit/src/hir.rs index 2f8f21225524d5..3f1ed83e4bd9b3 100644 --- a/zjit/src/hir.rs +++ b/zjit/src/hir.rs @@ -5299,6 +5299,20 @@ impl ProfileOracle { } } +fn invalidates_locals(opcode: u32, operands: *const VALUE) -> bool { + match opcode { + // Control-flow is non-leaf in the interpreter because it can execute arbitrary code on + // interrupt. But in the JIT, we side-exit if there is a pending interrupt. + YARVINSN_jump + | YARVINSN_branchunless + | YARVINSN_branchif + | YARVINSN_branchnil + | YARVINSN_leave => false, + // TODO(max): Read the invokebuiltin target from operands and determine if it's leaf + _ => unsafe { !rb_zjit_insn_leaf(opcode as i32, operands) } + } +} + /// The index of the self parameter in the HIR function pub const SELF_PARAM_IDX: usize = 0; @@ -5434,7 +5448,7 @@ pub fn iseq_to_hir(iseq: *const rb_iseq_t) -> Result { } // Flag a future getlocal/setlocal to add a patch point if this instruction is not leaf. - if unsafe { !rb_zjit_insn_leaf(opcode as i32, pc.offset(1)) } { + if invalidates_locals(opcode, unsafe { pc.offset(1) }) { local_inval = true; } diff --git a/zjit/src/hir/opt_tests.rs b/zjit/src/hir/opt_tests.rs index 166d1d4754591e..2a70314fbb7f38 100644 --- a/zjit/src/hir/opt_tests.rs +++ b/zjit/src/hir/opt_tests.rs @@ -9638,26 +9638,24 @@ mod hir_opt_tests { Jump bb2(v8, v9, v10, v11, v12) bb2(v14:BasicObject, v15:BasicObject, v16:BasicObject, v17:BasicObject, v18:NilClass): CheckInterrupts - v27:BasicObject = GetLocal :a, l0, EP@6 - SetLocal :formatted, l0, EP@3, v27 - v39:BasicObject = GetLocal :formatted, l0, EP@3 + SetLocal :formatted, l0, EP@3, v15 PatchPoint SingleRactorMode - v56:HeapBasicObject = GuardType v14, HeapBasicObject - v57:HeapBasicObject = GuardShape v56, 0x1000 - StoreField v57, :@formatted@0x1001, v39 - WriteBarrier v57, v39 - v60:CShape[0x1002] = Const CShape(0x1002) - StoreField v57, :_shape_id@0x1003, v60 - v45:Class[VMFrozenCore] = Const Value(VALUE(0x1008)) + v54:HeapBasicObject = GuardType v14, HeapBasicObject + v55:HeapBasicObject = GuardShape v54, 0x1000 + StoreField v55, :@formatted@0x1001, v15 + WriteBarrier v55, v15 + v58:CShape[0x1002] = Const CShape(0x1002) + StoreField v55, :_shape_id@0x1003, v58 + v43:Class[VMFrozenCore] = Const Value(VALUE(0x1008)) PatchPoint MethodRedefined(Class@0x1010, lambda@0x1018, cme:0x1020) PatchPoint NoSingletonClass(Class@0x1010) - v65:BasicObject = CCallWithFrame v45, :RubyVM::FrozenCore.lambda@0x1048, block=0x1050 - v48:BasicObject = GetLocal :a, l0, EP@6 - v49:BasicObject = GetLocal :_b, l0, EP@5 - v50:BasicObject = GetLocal :_c, l0, EP@4 - v51:BasicObject = GetLocal :formatted, l0, EP@3 + v63:BasicObject = CCallWithFrame v43, :RubyVM::FrozenCore.lambda@0x1048, block=0x1050 + v46:BasicObject = GetLocal :a, l0, EP@6 + v47:BasicObject = GetLocal :_b, l0, EP@5 + v48:BasicObject = GetLocal :_c, l0, EP@4 + v49:BasicObject = GetLocal :formatted, l0, EP@3 CheckInterrupts - Return v65 + Return v63 "); } diff --git a/zjit/src/hir/tests.rs b/zjit/src/hir/tests.rs index f67874fad7a832..9810e48145c16d 100644 --- a/zjit/src/hir/tests.rs +++ b/zjit/src/hir/tests.rs @@ -1069,17 +1069,14 @@ pub mod hir_build_tests { v18:CBool = Test v11 IfFalse v18, bb3(v10, v11, v12) v22:Fixnum[3] = Const Value(3) - PatchPoint NoEPEscape(test) CheckInterrupts Jump bb4(v10, v11, v22) - bb3(v29:BasicObject, v30:BasicObject, v31:NilClass): - v35:Fixnum[4] = Const Value(4) - PatchPoint NoEPEscape(test) - Jump bb4(v29, v30, v35) - bb4(v40:BasicObject, v41:BasicObject, v42:Fixnum): - PatchPoint NoEPEscape(test) + bb3(v27:BasicObject, v28:BasicObject, v29:NilClass): + v33:Fixnum[4] = Const Value(4) + Jump bb4(v27, v28, v33) + bb4(v36:BasicObject, v37:BasicObject, v38:Fixnum): CheckInterrupts - Return v42 + Return v38 "); } @@ -1366,23 +1363,20 @@ pub mod hir_build_tests { CheckInterrupts Jump bb4(v10, v16, v20) bb4(v26:BasicObject, v27:BasicObject, v28:BasicObject): - PatchPoint NoEPEscape(test) - v34:Fixnum[0] = Const Value(0) - v37:BasicObject = SendWithoutBlock v28, :>, v34 # SendFallbackReason: Uncategorized(opt_gt) + v32:Fixnum[0] = Const Value(0) + v35:BasicObject = SendWithoutBlock v28, :>, v32 # SendFallbackReason: Uncategorized(opt_gt) CheckInterrupts - v40:CBool = Test v37 - IfTrue v40, bb3(v26, v27, v28) - v43:NilClass = Const Value(nil) - PatchPoint NoEPEscape(test) + v38:CBool = Test v35 + IfTrue v38, bb3(v26, v27, v28) + v41:NilClass = Const Value(nil) CheckInterrupts Return v27 - bb3(v53:BasicObject, v54:BasicObject, v55:BasicObject): - PatchPoint NoEPEscape(test) - v62:Fixnum[1] = Const Value(1) - v65:BasicObject = SendWithoutBlock v54, :+, v62 # SendFallbackReason: Uncategorized(opt_plus) - v70:Fixnum[1] = Const Value(1) - v73:BasicObject = SendWithoutBlock v55, :-, v70 # SendFallbackReason: Uncategorized(opt_minus) - Jump bb4(v53, v65, v73) + bb3(v49:BasicObject, v50:BasicObject, v51:BasicObject): + v56:Fixnum[1] = Const Value(1) + v59:BasicObject = SendWithoutBlock v50, :+, v56 # SendFallbackReason: Uncategorized(opt_plus) + v64:Fixnum[1] = Const Value(1) + v67:BasicObject = SendWithoutBlock v51, :-, v64 # SendFallbackReason: Uncategorized(opt_minus) + Jump bb4(v49, v59, v67) "); } @@ -3064,15 +3058,13 @@ pub mod hir_build_tests { CheckInterrupts v35:CBool[true] = Test v32 IfFalse v35, bb3(v16, v17, v18, v19, v20, v25) - PatchPoint NoEPEscape(open) - v42:BasicObject = InvokeBlock, v25 # SendFallbackReason: Uncategorized(invokeblock) - v45:BasicObject = InvokeBuiltin dir_s_close, v16, v25 + v40:BasicObject = InvokeBlock, v25 # SendFallbackReason: Uncategorized(invokeblock) + v43:BasicObject = InvokeBuiltin dir_s_close, v16, v25 CheckInterrupts - Return v42 - bb3(v51, v52, v53, v54, v55, v56): - PatchPoint NoEPEscape(open) + Return v40 + bb3(v49, v50, v51, v52, v53, v54): CheckInterrupts - Return v56 + Return v54 "); } @@ -3548,12 +3540,10 @@ pub mod hir_build_tests { v22:Fixnum[1] = Const Value(1) v24:Fixnum[1] = Const Value(1) v27:BasicObject = SendWithoutBlock v22, :+, v24 # SendFallbackReason: Uncategorized(opt_plus) - PatchPoint NoEPEscape(test) Jump bb3(v10, v27, v12) - bb3(v32:BasicObject, v33:BasicObject, v34:BasicObject): - PatchPoint NoEPEscape(test) + bb3(v30:BasicObject, v31:BasicObject, v32:BasicObject): CheckInterrupts - Return v33 + Return v31 "); }