From 43825fba6eb39980130fd9bf47acb2000cde55d3 Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Fri, 25 Aug 2023 18:52:02 -0700 Subject: YJIT: Handle getblockparamproxy with ifunc getblockparamproxy for "ifunc" behaves identically to iseq, in just pushing rb_block_param_proxy. --- test/ruby/test_yjit.rb | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'test/ruby') 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 -- cgit v1.2.3