summaryrefslogtreecommitdiff
path: root/test/ruby/test_jit.rb
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-24 15:41:14 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-24 15:41:14 +0000
commit97f3e426a1c84d9bee604fbe458cb110e80c93af (patch)
tree89211ca85227502f1af22fba76873dcf7c59359b /test/ruby/test_jit.rb
parent593b58534fcedab2392f3c97c7e1faf5ae972875 (diff)
_mjit_compile_ivar.erb: cancel on undefined ivar
I assumed somehow this check was not needed, but it did need. By canceling this instead of just warning here, we didn't lose the current performance so much. test_jit.rb: test the case that reproduces SEGV by that. TestGemStreamUI.rb: delete. This test on --jit-wait is fixed. === Optcarrot Benchmark === $ benchmark-driver benchmark.yml --rbenv 'before::before --disable-gems --jit;after::after --disable-gems --jit' -v --repeat-count 24 before: ruby 2.6.0dev (2018-10-24 trunk 65355) +JIT [x86_64-linux] after: ruby 2.6.0dev (2018-10-24 trunk 65355) +JIT [x86_64-linux] last_commit=_mjit_compile_ivar.erb: cancel on undefined ivar Calculating ------------------------------------- before after Optcarrot Lan_Master.nes 85.344 84.849 fps Comparison: Optcarrot Lan_Master.nes before: 85.3 fps after: 84.8 fps - 1.01x slower git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_jit.rb')
-rw-r--r--test/ruby/test_jit.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb
index 888290faa9..5c31b504c4 100644
--- a/test/ruby/test_jit.rb
+++ b/test/ruby/test_jit.rb
@@ -669,6 +669,27 @@ class TestJIT < Test::Unit::TestCase
end;
end
+ def test_inlined_undefined_ivar
+ assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: "bbb", success_count: 2, min_calls: 3)
+ begin;
+ class Foo
+ def initialize
+ @a = :a
+ end
+
+ def bar
+ if @b.nil?
+ @b = :b
+ end
+ end
+ end
+
+ print(Foo.new.bar)
+ print(Foo.new.bar)
+ print(Foo.new.bar)
+ end;
+ end
+
def test_attr_reader
assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: "4nil\nnil\n6", success_count: 2, min_calls: 2)
begin;