summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2025-05-29 12:35:46 -0400
committerAlan Wu <XrXr@users.noreply.github.com>2025-06-04 06:23:30 -0400
commit8d14d6ea2d9e278a04ebe7e5805221f4cd4cd950 (patch)
tree5127dc3b2f49cc1397cec32a2ab792de1645bb0d /test/ruby
parent6f0f84e5dd1fc603a646d744d64eedcfef43f7c1 (diff)
ZJIT: Spill to the stack using arguments instead of FrameState
The FrameState on the SendWithoutBlock represents the entry state, but for instructions that push to the stack in the middle of the instruction before actually doing the send like opt_aref_with, the FrameState is incorrect. We need to write to the stack using the arguments for the instruction.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/13468
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_zjit.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_zjit.rb b/test/ruby/test_zjit.rb
index 4452f413f0..796851a9bf 100644
--- a/test/ruby/test_zjit.rb
+++ b/test/ruby/test_zjit.rb
@@ -487,6 +487,14 @@ class TestZJIT < Test::Unit::TestCase
}, call_threshold: 5, num_profiles: 3
end
+ def test_opt_aref_with
+ assert_compiles ':ok', %q{
+ def aref_with(hash) = hash["key"]
+
+ aref_with({ "key" => :ok })
+ }
+ end
+
# tool/ruby_vm/views/*.erb relies on the zjit instructions a) being contiguous and
# b) being reliably ordered after all the other instructions.
def test_instruction_order