Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b21edc1
ZJIT: Add assume_no_singleton_classes to avoid invalidation loops (#1…
tekknolagi Jan 14, 2026
0687139
[DOC] Add docs for WeakMap#inspect
peterzhu2118 Jan 13, 2026
ac22989
YJIT: Add crashing test for --yjit-dump-insns
XrXr Jan 9, 2026
9930468
YJIT: Fix --yjit-dump-insns by removing {cpush,cpop}_all() in printers
XrXr Jan 14, 2026
9f3225d
YJIT: Properly preserve register mapping in cpush_all() and cpop_all()
XrXr Jan 14, 2026
cdb2b0e
YJIT: A64: In CPopAll, pop into the register before using MSR
XrXr Jan 14, 2026
4a21b83
ZJIT: Optimize common `invokesuper` cases (#15816)
nirvdrum Jan 15, 2026
806031d
Windows: Remove workaround for LLVM windres
larskanis Dec 18, 2024
189bb64
[ci-skip] Shorter example for `Module#instance_method`
okuramasafumi Dec 14, 2023
886202b
Count assertions in child processes
nobu Jan 15, 2026
de17b84
Update bundled gems list as of 2026-01-15
matzbot Jan 15, 2026
943b085
[Bug #21723] Let `binding.irb` properly load irb by fixing force_acti…
osyoyu Dec 2, 2025
270c7fc
Fake BUNDLE_GEMFILE and BUNDLE_LOCKFILE to let checks pass
osyoyu Dec 4, 2025
a28c856
Add comments
osyoyu Dec 4, 2025
2d79cc9
Added example for bundle/inline
hsbt Jan 15, 2026
ca9c618
Suppress bundled gem warning on `binding.irb'
osyoyu Dec 2, 2025
6afac93
Restore irb to warning target
hsbt Jan 15, 2026
11edc28
Make `Array#map` and `Array#select` more tolerant
nobu Jan 15, 2026
065db7c
ZJIT: Rename ArrayArefFixnum -> ArrayAref
nozomemein Jan 9, 2026
256c806
ZJIT: Write the result of UnboxFixnum HIR as type spec so that we can…
nozomemein Jan 10, 2026
844f072
ZJIT: Inline ArrayAref
nozomemein Jan 14, 2026
ce390f1
ZJIT: Remove redundant unboxing
nozomemein Jan 14, 2026
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
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ releases.
* typeprof 0.31.1
* debug 1.11.1
* mutex_m 0.3.0
* resolv-replace 0.2.0
* rdoc 7.1.0

### RubyGems and Bundler
Expand Down
7 changes: 5 additions & 2 deletions array.rb
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ def map # :nodoc:
value = nil
result = Primitive.ary_sized_alloc
while Primitive.cexpr!(%q{ ary_fetch_next(self, LOCAL_PTR(_i), LOCAL_PTR(value)) })
result << yield(value)
value = yield(value)
Primitive.cexpr!(%q{ rb_ary_push(result, value) })
end
result
end
Expand All @@ -270,7 +271,9 @@ def select # :nodoc:
value = nil
result = Primitive.ary_sized_alloc
while Primitive.cexpr!(%q{ ary_fetch_next(self, LOCAL_PTR(_i), LOCAL_PTR(value)) })
result << value if yield value
if yield value
Primitive.cexpr!(%q{ rb_ary_push(result, value) })
end
end
result
end
Expand Down
2 changes: 0 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,6 @@ AS_CASE(["$target_os"],
])
rb_cv_binary_elf=no
: ${enable_shared=yes}
AS_IF([$WINDRES --version | grep LLVM > /dev/null], [USE_LLVM_WINDRES=yes], [USE_LLVM_WINDRES=no])
],
[hiuxmpp*], [AC_DEFINE(__HIUX_MPP__)]) # by TOYODA Eizi <toyoda@npd.kishou.go.jp>

Expand Down Expand Up @@ -4414,7 +4413,6 @@ AC_SUBST(MINIOBJS)
AC_SUBST(THREAD_MODEL)
AC_SUBST(COROUTINE_TYPE, ${coroutine_type})
AC_SUBST(PLATFORM_DIR)
AC_SUBST(USE_LLVM_WINDRES)

firstmf=`echo $FIRSTMAKEFILE | sed 's/:.*//'`
firsttmpl=`echo $FIRSTMAKEFILE | sed 's/.*://'`
Expand Down
11 changes: 3 additions & 8 deletions cygwin/GNUmakefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,9 @@ MUNICODE_FLAG := $(if $(filter mingw%,$(target_os)),-municode)
override EXE_LDFLAGS += $(MUNICODE_FLAG)

DLLWRAP = @DLLWRAP@ --target=$(target_os) --driver-name="$(CC)"
ifeq (@USE_LLVM_WINDRES@,yes) # USE_LLVM_WINDRES
# llvm-windres fails when preprocessor options are added
windres-cpp :=
else
windres-cpp := $(CPP) -xc
windres-cpp := --preprocessor=$(firstword $(windres-cpp)) \
$(addprefix --preprocessor-arg=,$(wordlist 2,$(words $(windres-cpp)),$(windres-cpp)))
endif
windres-cpp := $(CPP) -xc
windres-cpp := --preprocessor=$(firstword $(windres-cpp)) \
$(addprefix --preprocessor-arg=,$(wordlist 2,$(words $(windres-cpp)),$(windres-cpp)))
WINDRES = @WINDRES@ $(windres-cpp) -DRC_INVOKED
STRIP = @STRIP@

Expand Down
2 changes: 1 addition & 1 deletion gems/bundled_gems
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ base64 0.3.0 https://github.com/ruby/base64
bigdecimal 4.0.1 https://github.com/ruby/bigdecimal
observer 0.1.2 https://github.com/ruby/observer
abbrev 0.1.2 https://github.com/ruby/abbrev
resolv-replace 0.1.1 https://github.com/ruby/resolv-replace
resolv-replace 0.2.0 https://github.com/ruby/resolv-replace
rinda 0.2.0 https://github.com/ruby/rinda
drb 2.2.3 https://github.com/ruby/drb
nkf 0.2.0 https://github.com/ruby/nkf
Expand Down
1 change: 1 addition & 0 deletions insns.def
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,7 @@ invokesuper
(VALUE val)
// attr rb_snum_t sp_inc = sp_inc_of_sendish(cd->ci);
// attr rb_snum_t comptime_sp_inc = sp_inc_of_sendish(ci);
// attr bool zjit_profile = true;
{
VALUE bh = vm_caller_setup_arg_block(ec, GET_CFP(), cd->ci, blockiseq, true);
val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_super);
Expand Down
27 changes: 21 additions & 6 deletions lib/bundled_gems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ def self.warning?(name, specs: nil)
false
end

if suppress_list = Thread.current[:__bundled_gems_warning_suppression]
return if suppress_list.include?(name) || suppress_list.include?(feature)
end

return if specs.include?(name)

# Don't warn if a hyphenated gem provides this feature
Expand Down Expand Up @@ -207,19 +211,28 @@ def self.force_activate(gem)
require "bundler"
Bundler.reset!

# Build and activate a temporary definition containing the original gems + the requested gem
builder = Bundler::Dsl.new

if Bundler::SharedHelpers.in_bundle?
if Bundler.locked_gems
Bundler.locked_gems.specs.each{|spec| builder.gem spec.name, spec.version.to_s }
elsif Bundler.definition.gemfiles.size > 0
Bundler.definition.gemfiles.each{|gemfile| builder.eval_gemfile(gemfile) }
lockfile = nil
if Bundler::SharedHelpers.in_bundle? && Bundler.definition.gemfiles.size > 0
Bundler.definition.gemfiles.each {|gemfile| builder.eval_gemfile(gemfile) }
lockfile = begin
Bundler.default_lockfile
rescue Bundler::GemfileNotFound
nil
end
else
# Fake BUNDLE_GEMFILE and BUNDLE_LOCKFILE to let checks pass
orig_gemfile = ENV["BUNDLE_GEMFILE"]
orig_lockfile = ENV["BUNDLE_LOCKFILE"]
Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", "Gemfile"
Bundler::SharedHelpers.set_env "BUNDLE_LOCKFILE", "Gemfile.lock"
end

builder.gem gem

definition = builder.to_definition(nil, true)
definition = builder.to_definition(lockfile, nil)
definition.validate_runtime!

begin
Expand All @@ -235,6 +248,8 @@ def self.force_activate(gem)
rescue Bundler::GemNotFound
warn "Failed to activate #{gem}, please install it with 'gem install #{gem}'"
ensure
ENV['BUNDLE_GEMFILE'] = orig_gemfile if orig_gemfile
ENV['BUNDLE_LOCKFILE'] = orig_lockfile if orig_lockfile
Bundler.ui = orig_ui
Bundler::Definition.no_lock = orig_no_lock
end
Expand Down
5 changes: 5 additions & 0 deletions prelude.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
class Binding
# :nodoc:
def irb(...)
suppress = Thread.current[:__bundled_gems_warning_suppression]
Thread.current[:__bundled_gems_warning_suppression] = ['reline', 'rdoc']

begin
require 'irb'
rescue LoadError, Gem::LoadError
Gem::BUNDLED_GEMS.force_activate 'irb'
require 'irb'
end
irb(...)
ensure
Thread.current[:__bundled_gems_warning_suppression] = suppress
end

# suppress redefinition warning
Expand Down
36 changes: 18 additions & 18 deletions proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2371,29 +2371,29 @@ rb_obj_singleton_method(VALUE obj, VALUE vid)
*
* Returns an +UnboundMethod+ representing the given
* instance method in _mod_.
* See +UnboundMethod+ about how to utilize it
*
* class Interpreter
* def do_a() print "there, "; end
* def do_d() print "Hello "; end
* def do_e() print "!\n"; end
* def do_v() print "Dave"; end
* Dispatcher = {
* "a" => instance_method(:do_a),
* "d" => instance_method(:do_d),
* "e" => instance_method(:do_e),
* "v" => instance_method(:do_v)
* }
* def interpret(string)
* string.each_char {|b| Dispatcher[b].bind(self).call }
* end
* end
* class Person
* def initialize(name)
* @name = name
* end
*
* def hi
* puts "Hi, I'm #{@name}!"
* end
* end
*
* dave = Person.new('Dave')
* thomas = Person.new('Thomas')
*
* interpreter = Interpreter.new
* interpreter.interpret('dave')
* hi = Person.instance_method(:hi)
* hi.bind_call(dave)
* hi.bind_call(thomas)
*
* <em>produces:</em>
*
* Hello there, Dave!
* Hi, I'm Dave!
* Hi, I'm Thomas!
*/

static VALUE
Expand Down
24 changes: 24 additions & 0 deletions spec/bundled_gems_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,30 @@ def my
end
end

context "with bundler/inline" do
it "foo is available on LOAD_PATH" do
build_lib "foo", "1.0.0" do |s|
s.write "lib/foo.rb", "puts :foo"
end

script <<-RUBY, env: { "BUNDLER_SPEC_GEM_REPO" => gem_repo1.to_s }
#!/usr/bin/env ruby
gemfile do
source "https://gem.repo1"
path "#{lib_path}" do
gem "foo", "1.0.0"
end
end

Gem::BUNDLED_GEMS.force_activate("csv")
puts $LOAD_PATH
RUBY

expect(err).to include("gem install csv")
expect(out).to include("foo-1.0.0/lib")
end
end

context "without bundle environment" do
it "warns about installation requirement" do
expect_any_instance_of(Object).to receive(:warn)
Expand Down
22 changes: 22 additions & 0 deletions test/ruby/test_array.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1336,6 +1336,28 @@ def test_prepend
assert_equal(@cls[@cls[1,2], nil, 'dog', 'cat'], a.prepend(@cls[1, 2]))
end

def test_tolerant_to_redefinition
*code = __FILE__, __LINE__+1, "#{<<-"{#"}\n#{<<-'};'}"
{#
module M
def <<(a)
super(a * 2)
end
end
class Array; prepend M; end
ary = [*1..10]
mapped = ary.map {|i| i}
selected = ary.select {true}
module M
remove_method :<<
end
assert_equal(ary, mapped)
assert_equal(ary, selected)
};
assert_separately(%w[--disable-yjit], *code)
assert_separately(%w[--enable-yjit], *code)
end

def test_push
a = @cls[1, 2, 3]
assert_equal(@cls[1, 2, 3, 4, 5], a.push(4, 5))
Expand Down
12 changes: 12 additions & 0 deletions test/ruby/test_yjit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1804,6 +1804,18 @@ def bar(w:, x:, y:, z:, **kwrest) = yield kwrest
RUBY
end

def test_yjit_dump_insns
# Testing that this undocumented debugging feature doesn't crash
args = [
'--yjit-call-threshold=1',
'--yjit-dump-insns',
'-e def foo(case:) = {case:}[:case]',
'-e foo(case:0)',
]
_out, _err, status = invoke_ruby(args, '', true, true)
assert_not_predicate(status, :signaled?)
end

private

def code_gc_helpers
Expand Down
Loading