From fc5ee247d5307a292cd2b083ce82fc24005bb385 Mon Sep 17 00:00:00 2001 From: Daniel Colson Date: Tue, 19 Aug 2025 10:02:13 -0400 Subject: ZJIT: Compile toregexp (#14200) `toregexp` is fairly similar to `concatstrings`, so this commit extracts a helper for pushing and popping operands on the native stack. There's probably opportunity to move some of this into lir (e.g. Alan suggested a push_many that could use STP on ARM to push 2 at a time), but I might save that for another day. --- test/ruby/test_zjit.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_zjit.rb b/test/ruby/test_zjit.rb index 96ac99b6db..e18333a58f 100644 --- a/test/ruby/test_zjit.rb +++ b/test/ruby/test_zjit.rb @@ -1847,6 +1847,14 @@ class TestZJIT < Test::Unit::TestCase }, insns: [:concatstrings] end + def test_regexp_interpolation + assert_compiles '/123/', %q{ + def test = /#{1}#{2}#{3}/ + + test + }, insns: [:toregexp] + end + private # Assert that every method call in `test_script` can be compiled by ZJIT -- cgit v1.2.3