[前][次][番号順一覧][スレッド一覧]

ruby-changes:55251

From: k0kubun <ko1@a...>
Date: Sat, 6 Apr 2019 11:53:37 +0900 (JST)
Subject: [ruby-changes:55251] k0kubun:r67458 (trunk): Cover all insns in test_jit again

k0kubun	2019-04-06 11:53:32 +0900 (Sat, 06 Apr 2019)

  New Revision: 67458

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67458

  Log:
    Cover all insns in test_jit again

  Modified files:
    trunk/test/ruby/test_jit.rb
Index: test/ruby/test_jit.rb
===================================================================
--- test/ruby/test_jit.rb	(revision 67457)
+++ test/ruby/test_jit.rb	(revision 67458)
@@ -183,14 +183,34 @@ class TestJIT < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_jit.rb#L183
     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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_jit.rb#L990
     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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]