Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ a0f7de814ae5c299d6ce99bed5fb308a05d50ba0
d4e24021d39e1f80f0055b55d91f8d5f22e15084
7a56c316418980b8a41fcbdc94067b2bda2ad112
e90282be7ba1bc8e3119f6e1a2c80356ceb3f80a
26a9e0b4e31f7b5a9cbd755e0a15823a8fa51bae
2f53985da9ee593fe524d408256835667938c7d7
6 changes: 6 additions & 0 deletions .github/workflows/zjit-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
15 changes: 15 additions & 0 deletions .rdoc_options
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ rdoc_include:
exclude:
- \.gemspec\z

generator_name: aliki

autolink_excluded_words:
- Box
- Class
- Method
- Module
Expand All @@ -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
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdint.h>
uint64_t atomic_var;]],
[[
Expand Down
4 changes: 2 additions & 2 deletions gems/bundled_gems
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions imemo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
Expand Down
4 changes: 2 additions & 2 deletions test/cgi/test_cgi_escape.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
17 changes: 17 additions & 0 deletions test/ruby/test_box.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down