summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@ruby-lang.org>2021-04-29 17:49:55 +0900
committernagachika <nagachika@ruby-lang.org>2021-04-29 17:49:55 +0900
commitcc4e602634e894c831a4103a5803a3de566c1856 (patch)
tree8250b3992dc55c5572b2edcafcafa0b385dfe1b6 /test
parent58240b5d0b52d9685b773e5b9e45d22ca500392a (diff)
merge revision(s) 87c546b5fa97e6e226cce4daf417617a1143f642,7a3322a0fd660d676f1918bd7c4a37676b44e1c2:
Avoid using inconsistent coding style Other `_mjit_compile_*.erb` files don't use goto. These files'd better be consistent for readability. --- tool/ruby_vm/views/_mjit_compile_getinlinecache.erb | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) Fix broken JIT of getinlinecache e7fc353f04 reverted vm_ic_hit_p's signature change made in 53babf35ef, which broke JIT compilation of getinlinecache. To make sure it doesn't happen again, I separated vm_inlined_ic_hit_p to make the intention clear. --- test/ruby/test_jit.rb | 12 +++++++++++ .../ruby_vm/views/_mjit_compile_getinlinecache.erb | 2 +- vm_insnhelper.c | 25 ++++++++++++++-------- 3 files changed, 29 insertions(+), 10 deletions(-)
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_jit.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb
index 3a38b1a998..be3550033d 100644
--- a/test/ruby/test_jit.rb
+++ b/test/ruby/test_jit.rb
@@ -857,6 +857,18 @@ class TestJIT < Test::Unit::TestCase
end;
end
+ def test_inlined_getconstant
+ assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: '11', success_count: 1, min_calls: 2)
+ begin;
+ FOO = 1
+ def const
+ FOO
+ end
+ print const
+ print const
+ end;
+ end
+
def test_attr_reader
assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: "4nil\nnil\n6", success_count: 2, min_calls: 2)
begin;