diff options
| author | John Hawthorn <john@hawthorn.email> | 2023-08-25 18:52:02 -0700 |
|---|---|---|
| committer | Alan Wu <XrXr@users.noreply.github.com> | 2023-08-31 10:46:24 -0400 |
| commit | 43825fba6eb39980130fd9bf47acb2000cde55d3 (patch) | |
| tree | de6ca9d35b3c3eaf244f2654bf0f7a24f4d7d938 /test/ruby | |
| parent | 0270210e4984957427a4cf3824b724b62bfa2eaf (diff) | |
YJIT: Handle getblockparamproxy with ifunc
getblockparamproxy for "ifunc" behaves identically to iseq, in just
pushing rb_block_param_proxy.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/8300
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_yjit.rb | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/test/ruby/test_yjit.rb b/test/ruby/test_yjit.rb index 5347028550..cc9507aff4 100644 --- a/test/ruby/test_yjit.rb +++ b/test/ruby/test_yjit.rb @@ -547,8 +547,7 @@ class TestYJIT < Test::Unit::TestCase end def test_getblockparamproxy - # Currently two side exits as OPTIMIZED_METHOD_TYPE_CALL is unimplemented - assert_compiles(<<~'RUBY', insns: [:getblockparamproxy]) + assert_compiles(<<~'RUBY', insns: [:getblockparamproxy], exits: {}) def foo &blk p blk.call p blk.call @@ -559,6 +558,24 @@ class TestYJIT < Test::Unit::TestCase RUBY end + def test_ifunc_getblockparamproxy + assert_compiles(<<~'RUBY', insns: [:getblockparamproxy], exits: {}) + class Foo + include Enumerable + + def each(&block) + block.call 1 + block.call 2 + block.call 3 + end + end + + foo = Foo.new + foo.map { _1 * 2 } + foo.map { _1 * 2 } + RUBY + end + def test_send_blockarg assert_compiles(<<~'RUBY', insns: [:getblockparamproxy, :send], exits: {}) def bar |
