diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2022-12-01 07:59:56 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-01 10:59:56 -0500 |
commit | 2c939458cab06b4fda09b55a57b8bac30efe6b17 (patch) | |
tree | 78f2509fe19c8dda9dc5c2f2d0dcf10d739554cb /test | |
parent | 5872fd6f6cc5ddde33df94fb11e773eeb653e55e (diff) |
YJIT: Reorder branches for Fixnum opt_case_dispatch (#6841)
* YJIT: Reorder branches for Fixnum opt_case_dispatch
Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
* YJIT: Don't support too large values
Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
Notes
Notes:
Merged-By: maximecb <maximecb@ruby-lang.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_yjit.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/ruby/test_yjit.rb b/test/ruby/test_yjit.rb index aa29cf471f..1020257580 100644 --- a/test/ruby/test_yjit.rb +++ b/test/ruby/test_yjit.rb @@ -843,6 +843,23 @@ class TestYJIT < Test::Unit::TestCase RUBY end + def test_opt_case_dispatch + assert_compiles(<<~'RUBY', exits: :any, result: [:"1", "2", 3]) + def case_dispatch(val) + case val + when 1 + :"#{val}" + when 2 + "#{val}" + else + val + end + end + + [case_dispatch(1), case_dispatch(2), case_dispatch(3)] + RUBY + end + def test_code_gc assert_compiles(code_gc_helpers + <<~'RUBY', exits: :any, result: :ok) return :not_paged unless add_pages(100) # prepare freeable pages |