From 7a3322a0fd660d676f1918bd7c4a37676b44e1c2 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Mon, 4 Jan 2021 13:09:01 -0800 Subject: Fix broken JIT of getinlinecache e7fc353f04 reverted vm_ic_hit_p's signature change made in 53babf35ef, which broke JIT compilation of getinlinecache. To make sure it doesn't happen again, I separated vm_inlined_ic_hit_p to make the intention clear. --- test/ruby/test_jit.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/ruby/test_jit.rb') diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb index 61485c7479..3bc4a871a1 100644 --- a/test/ruby/test_jit.rb +++ b/test/ruby/test_jit.rb @@ -857,6 +857,18 @@ class TestJIT < Test::Unit::TestCase end; end + def test_inlined_getconstant + assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: '11', success_count: 1, min_calls: 2) + begin; + FOO = 1 + def const + FOO + end + print const + print const + end; + end + def test_attr_reader assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: "4nil\nnil\n6", success_count: 2, min_calls: 2) begin; -- cgit v1.2.3