summaryrefslogtreecommitdiff
path: root/test/ruby/test_jit.rb
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-06 02:53:32 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-06 02:53:32 +0000
commitf15d04358827d60a708f296973c420b2c031ac5e (patch)
treeb75ae5d7a7c0d26c2d038d50b3383158b25d3751 /test/ruby/test_jit.rb
parentfeecc10bfcf6fb95f60f62dbfcc9b23fc15813f2 (diff)
Cover all insns in test_jit again
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_jit.rb')
-rw-r--r--test/ruby/test_jit.rb29
1 files changed, 24 insertions, 5 deletions
diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb
index 5b5c21d76d..0079741a04 100644
--- a/test/ruby/test_jit.rb
+++ b/test/ruby/test_jit.rb
@@ -183,14 +183,34 @@ class TestJIT < Test::Unit::TestCase
assert_compile_once('2', result_inspect: '2', insns: %i[putobject])
end
- def test_compile_insn_definemethod
- assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: 'hello', success_count: 2, insns: %i[definemethod])
+ def test_compile_insn_definemethod_definesmethod
+ assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: 'helloworld', success_count: 3, insns: %i[definemethod definesmethod])
begin;
print 1.times.map {
def method_definition
'hello'
end
- method_definition
+
+ def self.smethod_definition
+ 'world'
+ end
+
+ method_definition + smethod_definition
+ }.join
+ end;
+ end
+
+ def test_compile_insn_putspecialobject
+ assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: 'a', success_count: 2, insns: %i[putspecialobject])
+ begin;
+ print 1.times.map {
+ def a
+ 'a'
+ end
+
+ alias :b :a
+
+ b
}.join
end;
end
@@ -970,8 +990,7 @@ class TestJIT < Test::Unit::TestCase
insns = iseq_array.last.select { |x| x.is_a?(Array) }.map(&:first)
iseq_array.last.each do |(insn, *args)|
case insn
- when :definemethod, :definesmethod,
- :send
+ when :definemethod, :definesmethod, :send
insns += collect_insns(args.last)
end
end