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

ruby-changes:51663

From: k0kubun <ko1@a...>
Date: Sat, 7 Jul 2018 23:41:10 +0900 (JST)
Subject: [ruby-changes:51663] k0kubun:r63875 (trunk): insns.def: stop pushing unnecessary keys for MJIT

k0kubun	2018-07-07 23:41:03 +0900 (Sat, 07 Jul 2018)

  New Revision: 63875

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

  Log:
    insns.def: stop pushing unnecessary keys for MJIT
    
    [Bug #14892]

  Modified files:
    trunk/insns.def
    trunk/test/ruby/test_jit.rb
Index: insns.def
===================================================================
--- insns.def	(revision 63874)
+++ insns.def	(revision 63875)
@@ -1260,7 +1260,9 @@ opt_aset_with https://github.com/ruby/ruby/blob/trunk/insns.def#L1260
     }
     else {
         PUSH(recv);
+#ifndef MJIT_HEADER
         PUSH(rb_str_resurrect(key));
+#endif
         PUSH(val);
 #ifndef MJIT_HEADER
         ADD_PC(-WIDTH_OF_opt_send_without_block);
@@ -1280,8 +1282,8 @@ opt_aref_with https://github.com/ruby/ruby/blob/trunk/insns.def#L1282
 
     if (val == Qundef) {
         PUSH(recv);
-        PUSH(rb_str_resurrect(key));
 #ifndef MJIT_HEADER
+        PUSH(rb_str_resurrect(key));
         ADD_PC(-WIDTH_OF_opt_send_without_block);
 #endif
 	DISPATCH_ORIGINAL_INSN(opt_send_without_block);
Index: test/ruby/test_jit.rb
===================================================================
--- test/ruby/test_jit.rb	(revision 63874)
+++ test/ruby/test_jit.rb	(revision 63875)
@@ -685,7 +685,7 @@ class TestJIT < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_jit.rb#L685
     end;
   end
 
-  def test_stack_pointer_with_regexpmatch
+  def test_program_pointer_with_regexpmatch
     assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: "aa", success_count: 1)
     begin;
       2.times do
@@ -694,6 +694,24 @@ class TestJIT < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_jit.rb#L694
       end
     end;
   end
+
+  def test_pushed_values_with_opt_aset_with
+    assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: "{}{}", success_count: 1)
+    begin;
+      2.times do
+        print(Thread.current["a"] = {})
+      end
+    end;
+  end
+
+  def test_pushed_values_with_opt_aref_with
+    assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: "nil\nnil\n", success_count: 1)
+    begin;
+      2.times do
+        p(Thread.current["a"])
+      end
+    end;
+  end
 
   private
 

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

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