diff options
Diffstat (limited to 'test/ruby/test_jit.rb')
-rw-r--r-- | test/ruby/test_jit.rb | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb index 7adb1e8d6d..332d6fc2ed 100644 --- a/test/ruby/test_jit.rb +++ b/test/ruby/test_jit.rb @@ -183,18 +183,6 @@ class TestJIT < Test::Unit::TestCase assert_compile_once('2', result_inspect: '2', insns: %i[putobject]) end - def test_compile_insn_putspecialobject_putiseq - assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: 'hellohello', success_count: 2, insns: %i[putspecialobject putiseq]) - begin; - print 2.times.map { - def method_definition - 'hello' - end - method_definition - }.join - end; - end - def test_compile_insn_putstring_concatstrings_tostring assert_compile_once('"a#{}b" + "c"', result_inspect: '"abc"', insns: %i[putstring concatstrings tostring]) end @@ -952,8 +940,10 @@ class TestJIT < Test::Unit::TestCase insns = [] RubyVM::InstructionSequence.compile(script).to_a.last.each do |(insn, *args)| case insn - when :putiseq, :send + when :send insns += collect_insns(args.last) + when :definemethod, :definesmethod + insns += collect_insns(args[1]) when :defineclass insns += collect_insns(args[1]) end @@ -968,7 +958,8 @@ 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 :putiseq, :send + when :definemethod, :definesmethod, + :send insns += collect_insns(args.last) end end |