ZJIT: Implement concatstrings insn (#14154)

Co-authored-by: Alexander Momchilov <alexander.momchilov@shopify.com>
This commit is contained in:
Stan Lo 2025-08-11 23:07:26 +01:00 committed by GitHub
parent 4f34eddbd3
commit e29d333454
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 161 additions and 38 deletions

View file

@ -1506,6 +1506,22 @@ class TestZJIT < Test::Unit::TestCase
}, call_threshold: 2
end
def test_string_concat
assert_compiles '"123"', %q{
def test = "#{1}#{2}#{3}"
test
}, insns: [:concatstrings]
end
def test_string_concat_empty
assert_compiles '""', %q{
def test = "#{}"
test
}, insns: [:concatstrings]
end
private
# Assert that every method call in `test_script` can be compiled by ZJIT