diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2020-07-04 15:37:20 -0700 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2020-07-04 16:02:46 -0700 |
commit | e4f7eee009ebe1f23ee3e5ea69ccd9ea1530bc6f (patch) | |
tree | ed8831c404096155d37ceb4837c925b0d61dc8b1 /test/ruby/test_jit.rb | |
parent | c1463625555b061a2b94c3b6c5581730b482a285 (diff) |
Check ROBJECT_EMBED on guards-merged ivar access
Fix CI failure like
http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/3043247
introduced by a69dd699ee630dd1086627dbca15a218a8538b6f
Diffstat (limited to 'test/ruby/test_jit.rb')
-rw-r--r-- | test/ruby/test_jit.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb index f929a8c851..08093a5817 100644 --- a/test/ruby/test_jit.rb +++ b/test/ruby/test_jit.rb @@ -921,6 +921,34 @@ class TestJIT < Test::Unit::TestCase end; end + def test_heap_promotion_of_ivar_in_the_middle_of_jit + assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: "true\ntrue\n", success_count: 2, min_calls: 2) + begin; + class A + def initialize + @iv0 = nil + @iv1 = [] + @iv2 = nil + end + + def test(add) + @iv0.nil? + @iv2.nil? + add_ivar if add + @iv1.empty? + end + + def add_ivar + @iv3 = nil + end + end + + a = A.new + p a.test(false) + p a.test(true) + end; + end + def test_jump_to_precompiled_branch assert_eval_with_jit("#{<<~'begin;'}\n#{<<~'end;'}", stdout: ".0", success_count: 1, min_calls: 1) begin; |