mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
ZJIT: Implement concatstrings
insn (#14154)
Co-authored-by: Alexander Momchilov <alexander.momchilov@shopify.com>
This commit is contained in:
parent
4f34eddbd3
commit
e29d333454
4 changed files with 161 additions and 38 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue