mirror of
https://github.com/ruby/ruby.git
synced 2025-08-26 06:25:31 +02:00
YJIT: Cancel on-stack jit_return on invalidation (#9086)
* YJIT: Cancel on-stack jit_return on invalidation Co-authored-by: Alan Wu <alansi.xingwu@shopify.com> * Use RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P --------- Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
This commit is contained in:
parent
5888a16a12
commit
ba1cdadfc8
3 changed files with 69 additions and 8 deletions
|
@ -1324,6 +1324,36 @@ class TestYJIT < Test::Unit::TestCase
|
|||
RUBY
|
||||
end
|
||||
|
||||
def test_return_to_invalidated_frame
|
||||
assert_compiles(code_gc_helpers + <<~RUBY, exits: :any, result: :ok)
|
||||
def jump
|
||||
[] # something not inlined
|
||||
end
|
||||
|
||||
def entry(code_gc)
|
||||
jit_exception(code_gc)
|
||||
jump # faulty jump after code GC. #jit_exception should not come back.
|
||||
end
|
||||
|
||||
def jit_exception(code_gc)
|
||||
if code_gc
|
||||
tap do
|
||||
RubyVM::YJIT.code_gc
|
||||
break # jit_exec_exception catches TAG_BREAK and re-enters JIT code
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
add_pages(100)
|
||||
jump # Compile #jump in a non-first page
|
||||
add_pages(100)
|
||||
entry(false) # Compile #entry and its call to #jump in another page
|
||||
entry(true) # Free #jump but not #entry
|
||||
|
||||
:ok
|
||||
RUBY
|
||||
end
|
||||
|
||||
def test_setivar_on_class
|
||||
# Bug in https://github.com/ruby/ruby/pull/8152
|
||||
assert_compiles(<<~RUBY, result: :ok)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue