summaryrefslogtreecommitdiff
path: root/test/ruby/test_jit.rb
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2019-09-04 10:53:20 +0900
committerTakashi Kokubun <takashikkbn@gmail.com>2019-09-04 11:10:21 +0900
commitc14b67b2a8cf60b37cfb221d8b97c6eb91833522 (patch)
tree51cda4a1a1819363e8e7dbdf74612804e4f21863 /test/ruby/test_jit.rb
parent77596fb7a91cc119b25ac9e19b3c8682709765b4 (diff)
Check frozen flag on MJIT setinstancevariable
It does not seem to have a significant performance impact, hopefully? ``` $ benchmark-driver -v benchmark.yml --rbenv 'before --jit;after --jit' --repeat-count=24 --output=all before --jit: ruby 2.7.0dev (2019-09-03T21:02:24Z master 77596fb7a9) +JIT [x86_64-linux] after --jit: ruby 2.7.0dev (2019-09-04T01:54:44Z master 7363e22d79) +JIT [x86_64-linux] Calculating ------------------------------------- before --jit after --jit Optcarrot Lan_Master.nes 48.44054595799523 71.67010255902900 fps 71.32797692837639 71.97846863769546 72.51921961607691 78.87360980544105 73.54082925611047 79.80408132389941 74.03503843709451 79.85739528572826 74.04863857926493 79.89850834901381 75.30266276129467 80.34607233076015 75.69063990896244 80.88474397425360 75.70458132587405 81.09234267781642 77.39842764662852 82.13766823612643 77.76922944068329 82.20398304840373 81.17984044023393 82.26722630628272 82.85235776076533 82.71375902781254 83.04906099135320 82.75893420702198 83.10214168136230 82.79668965325972 83.71456007558125 82.85131667916379 84.06658306760725 82.95676565411722 84.25690684305728 83.19972846225775 84.27938663923503 83.28510503845854 84.45467716218090 83.41003730434703 84.51563186125925 83.67773614721280 84.56139892968321 84.02082201151110 84.69819452180658 84.10495346787033 84.78125989622576 84.47867803506055 ``` Note for backporter: test_jit's `success_count` would be 1 in Ruby 2.6, since 2.7 introduced "MJIT recompile" on JIT-ed code cancel. [Bug #16139]
Diffstat (limited to 'test/ruby/test_jit.rb')
-rw-r--r--test/ruby/test_jit.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb
index dbd48df28d..16782a291f 100644
--- a/test/ruby/test_jit.rb
+++ b/test/ruby/test_jit.rb
@@ -739,6 +739,28 @@ class TestJIT < Test::Unit::TestCase
end;
end
+ def test_inlined_setivar_frozen
+ assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: "FrozenError\n", success_count: 2, min_calls: 3)
+ begin;
+ class A
+ def a
+ @a = 1
+ end
+ end
+
+ a = A.new
+ a.a
+ a.a
+ a.a
+ a.freeze
+ begin
+ a.a
+ rescue FrozenError => e
+ p e.class
+ end
+ end;
+ end
+
def test_attr_reader
assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: "4nil\nnil\n6", success_count: 2, min_calls: 2)
begin;