diff options
author | Jimmy Miller <jimmy.miller@shopify.com> | 2023-01-19 13:42:49 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-19 13:42:49 -0500 |
commit | 762a3d80f77db0f96d3e01ccd1cc7b3891f0cfcf (patch) | |
tree | a1437a0b91802041580bbc006909c4b8da364a96 /bootstraptest | |
parent | 8872ebec6a3edc8327b5f348656c73a52bceda4a (diff) | |
download | ruby-762a3d80f77db0f96d3e01ccd1cc7b3891f0cfcf.tar.gz |
Implement splat for cfuncs. Split exit exit cases to better capture where we are exiting (#6929)
YJIT: Implement splat for cfuncs. Split exit cases
This also implements a new check for ruby2keywords as the last
argument of a splat. This does mean that we generate more code, but in
actual benchmarks where we gained speed from this (binarytrees) I
don't see any significant slow down. I did have to struggle here with
the register allocator to find code that didn't allocate too many
registers. It's a bit hard when everything is implicit. But I think I
got to the minimal amount of copying and stuff given our current
allocation strategy.
Diffstat (limited to 'bootstraptest')
-rw-r--r-- | bootstraptest/test_yjit.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb index 9d9143d265..cbb3f145b0 100644 --- a/bootstraptest/test_yjit.rb +++ b/bootstraptest/test_yjit.rb @@ -3456,3 +3456,28 @@ assert_equal 'ok', %q{ cw(4) } + +assert_equal 'threw', %q{ + def foo(args) + wrap(*args) + rescue ArgumentError + 'threw' + end + + def wrap(a) + [a] + end + + foo([Hash.ruby2_keywords_hash({})]) +} + +assert_equal 'threw', %q{ + # C call + def bar(args) + Array(*args) + rescue ArgumentError + 'threw' + end + + bar([Hash.ruby2_keywords_hash({})]) +} |