Use GC.respond_to?(:compact) in bootstraptest/test_yjit.rb
defined?(GC.compact) will always return true even when compaction is not supported. We should use GC.respond_to?(:compact) instead.
This commit is contained in:
parent
644153bfa8
commit
f45eb3dcb9
Notes:
git
2024-10-15 18:34:42 +00:00
@ -123,7 +123,7 @@ assert_equal '[:ae, :ae]', %q{
|
|||||||
|
|
||||||
# regression test for GC marking stubs in invalidated code
|
# regression test for GC marking stubs in invalidated code
|
||||||
assert_normal_exit %q{
|
assert_normal_exit %q{
|
||||||
skip true unless defined?(GC.compact)
|
skip true unless GC.respond_to?(:compact)
|
||||||
garbage = Array.new(10_000) { [] } # create garbage to cause iseq movement
|
garbage = Array.new(10_000) { [] } # create garbage to cause iseq movement
|
||||||
eval(<<~RUBY)
|
eval(<<~RUBY)
|
||||||
def foo(n, garbage)
|
def foo(n, garbage)
|
||||||
@ -158,7 +158,7 @@ assert_equal '0', "0.abs(&nil)"
|
|||||||
|
|
||||||
# regression test for invokeblock iseq guard
|
# regression test for invokeblock iseq guard
|
||||||
assert_equal 'ok', %q{
|
assert_equal 'ok', %q{
|
||||||
skip :ok unless defined?(GC.compact)
|
skip :ok unless GC.respond_to?(:compact)
|
||||||
def foo = yield
|
def foo = yield
|
||||||
10.times do |i|
|
10.times do |i|
|
||||||
ret = eval("foo { #{i} }")
|
ret = eval("foo { #{i} }")
|
||||||
@ -1230,7 +1230,7 @@ assert_equal 'special', %q{
|
|||||||
|
|
||||||
# Test that object references in generated code get marked and moved
|
# Test that object references in generated code get marked and moved
|
||||||
assert_equal "good", %q{
|
assert_equal "good", %q{
|
||||||
skip :good unless defined?(GC.compact)
|
skip :good unless GC.respond_to?(:compact)
|
||||||
def bar
|
def bar
|
||||||
"good"
|
"good"
|
||||||
end
|
end
|
||||||
@ -2351,7 +2351,7 @@ assert_equal '123', %q{
|
|||||||
|
|
||||||
# Test EP == BP invalidation with moving ISEQs
|
# Test EP == BP invalidation with moving ISEQs
|
||||||
assert_equal 'ok', %q{
|
assert_equal 'ok', %q{
|
||||||
skip :ok unless defined?(GC.compact)
|
skip :ok unless GC.respond_to?(:compact)
|
||||||
def entry
|
def entry
|
||||||
ok = proc { :ok } # set #entry as an EP-escaping ISEQ
|
ok = proc { :ok } # set #entry as an EP-escaping ISEQ
|
||||||
[nil].reverse_each do # avoid exiting the JIT frame on the constant
|
[nil].reverse_each do # avoid exiting the JIT frame on the constant
|
||||||
|
Loading…
x
Reference in New Issue
Block a user