From e0b757f63aa6e720af6200171b2f0841d4efe7ed Mon Sep 17 00:00:00 2001 From: Nozomi Hijikata <121233810+nozomemein@users.noreply.github.com> Date: Tue, 10 Feb 2026 07:34:59 +0900 Subject: ZJIT: Compile getconstant insn (#16109) * ZJIT: Compile getconstant insn * ZJIT: add fixme comments for opt_getconstant_path * ZJIT: Address comments - Replace fixme with actionable todo comment - Fix type validation for GetConstant --- test/ruby/test_zjit.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_zjit.rb b/test/ruby/test_zjit.rb index 7b068e9898..095b690c7b 100644 --- a/test/ruby/test_zjit.rb +++ b/test/ruby/test_zjit.rb @@ -3380,6 +3380,21 @@ class TestZJIT < Test::Unit::TestCase }, call_threshold: 1, insns: [:opt_getconstant_path] end + def test_getconstant + assert_compiles '1', %q{ + class Foo + CONST = 1 + end + + def test(klass) + klass::CONST + end + + test(Foo) + test(Foo) + }, call_threshold: 2, insns: [:getconstant] + end + def test_expandarray_no_splat assert_compiles '[3, 4]', %q{ def test(o) -- cgit v1.2.3