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

ruby-changes:58693

From: Takashi <ko1@a...>
Date: Sun, 10 Nov 2019 14:56:57 +0900 (JST)
Subject: [ruby-changes:58693] 4570284ce1 (master): Test opt_invokebuiltin_delegate_leave in test_jit

https://git.ruby-lang.org/ruby.git/commit/?id=4570284ce1

From 4570284ce14c9f00114039e9b619584a8cad6a50 Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Sat, 9 Nov 2019 21:56:38 -0800
Subject: Test opt_invokebuiltin_delegate_leave in test_jit


diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb
index a4c3e32..75d4b28 100644
--- a/test/ruby/test_jit.rb
+++ b/test/ruby/test_jit.rb
@@ -20,6 +20,9 @@ class TestJIT < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_jit.rb#L20
     # not supported yet
     :defineclass,
     :opt_call_c_function,
+
+    # never used
+    :opt_invokebuiltin_delegate,
   ].each do |insn|
     if !RubyVM::INSTRUCTION_NAMES.include?(insn.to_s)
       warn "instruction #{insn.inspect} is not defined but included in TestJIT::TEST_PENDING_INSNS"
@@ -606,6 +609,12 @@ class TestJIT < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_jit.rb#L609
     assert_eval_with_jit('print [0].pack("c")', stdout: "\x00", success_count: 1)
   end
 
+  def test_compile_insn_opt_invokebuiltin_delegate_leave
+    insns = collect_insns(RubyVM::InstructionSequence.of("\x00".method(:unpack)).to_a)
+    mark_tested_insn(:opt_invokebuiltin_delegate_leave, used_insns: insns)
+    assert_eval_with_jit('print "\x00".unpack("c")', stdout: '[0]', success_count: 1)
+  end
+
   def test_jit_output
     out, err = eval_with_jit('5.times { puts "MJIT" }', verbose: 1, min_calls: 5)
     assert_equal("MJIT\n" * 5, out)
-- 
cgit v0.10.2


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

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