summaryrefslogtreecommitdiff
path: root/test/ruby/test_basicinstructions.rb
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2025-08-25 14:31:42 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2025-08-26 13:02:17 -0700
commitfb6e3a80009a744a4e0b75660f1ce6da65e20e6c (patch)
tree70b6b1666684d8c1c3531987024d018f1628bb1f /test/ruby/test_basicinstructions.rb
parent8df06d6d90e6accdda7db8564c0167ec9469db6c (diff)
Remove `opt_aref_with` and `opt_aset_with`
When these instructions were introduced it was common to read from a hash with mutable string literals. However, these days, I think these instructions are fairly rare. I tested this with the lobsters benchmark, and saw no difference in speed. In order to be sure, I tracked down every use of this instruction in the lobsters benchmark, and there were only 4 places where it was used. Additionally, this patch fixes a case where "chilled strings" should emit a warning but they don't. ```ruby class Foo def self.[](x)= x.gsub!(/hello/, "hi") end Foo["hello world"] ``` Removing these instructions shows this warning: ``` > ./miniruby -vw test.rb ruby 3.5.0dev (2025-08-25T21:36:50Z rm-opt_aref_with dca08e286c) +PRISM [arm64-darwin24] test.rb:2: warning: literal string will be frozen in the future (run with --debug-frozen-string-literal for more information) ``` [Feature #21553]
Diffstat (limited to 'test/ruby/test_basicinstructions.rb')
0 files changed, 0 insertions, 0 deletions