ruby-changes:61756
From: Takashi <ko1@a...>
Date: Thu, 18 Jun 2020 01:16:22 +0900 (JST)
Subject: [ruby-changes:61756] e544a3a23c (master): Remove obsoleted opt_call_c_function insn (#3232)
https://git.ruby-lang.org/ruby.git/commit/?id=e544a3a23c From e544a3a23cb80460d77dcb145ad1ff84f77524c0 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun <takashikkbn@g...> Date: Wed, 17 Jun 2020 09:16:01 -0700 Subject: Remove obsoleted opt_call_c_function insn (#3232) * Remove obsoleted opt_call_c_function insn * Keep opt_call_c_function with DEFINE_INSN_IF diff --git a/bootstraptest/test_insns.rb b/bootstraptest/test_insns.rb index abfb53f..8addbf7 100644 --- a/bootstraptest/test_insns.rb +++ b/bootstraptest/test_insns.rb @@ -412,8 +412,6 @@ tests = [ https://github.com/ruby/ruby/blob/trunk/bootstraptest/test_insns.rb#L412 class String; def =~ other; true; end; end 'true' =~ /true/ }, - - [ 'opt_call_c_function', 'Struct.new(:x).new.x = true', ], ] # normal path diff --git a/insns.def b/insns.def index ba95655..2257bcd 100644 --- a/insns.def +++ b/insns.def @@ -1455,7 +1455,7 @@ opt_regexpmatch2 https://github.com/ruby/ruby/blob/trunk/insns.def#L1455 } /* call native compiled method */ -DEFINE_INSN +DEFINE_INSN_IF(SUPPORT_CALL_C_FUNCTION) opt_call_c_function (rb_insn_func_t funcptr) () diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb index a5d5fb4..97c287f 100644 --- a/test/ruby/test_jit.rb +++ b/test/ruby/test_jit.rb @@ -22,7 +22,6 @@ class TestJIT < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_jit.rb#L22 TEST_PENDING_INSNS = RubyVM::INSTRUCTION_NAMES.select { |n| n.start_with?('trace_') }.map(&:to_sym) + [ # not supported yet :defineclass, - :opt_call_c_function, # to be tested :invokebuiltin, @@ -613,10 +612,6 @@ class TestJIT < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_jit.rb#L612 assert_compile_once("'true' =~ /true/", result_inspect: '0', insns: %i[opt_regexpmatch2]) end - def test_compile_insn_opt_call_c_function - skip "support this in opt_call_c_function (low priority)" - 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) diff --git a/tool/ruby_vm/views/mjit_compile.inc.erb b/tool/ruby_vm/views/mjit_compile.inc.erb index c975545..0d3678d 100644 --- a/tool/ruby_vm/views/mjit_compile.inc.erb +++ b/tool/ruby_vm/views/mjit_compile.inc.erb @@ -16,8 +16,7 @@ https://github.com/ruby/ruby/blob/trunk/tool/ruby_vm/views/mjit_compile.inc.erb#L16 } -%> % % unsupported_insns = [ -% 'defineclass', # low priority -% 'opt_call_c_function', # low priority +% 'defineclass', # low priority % ] % % opt_send_without_block = RubyVM::Instructions.find { |i| i.name == 'opt_send_without_block' } diff --git a/vm_opts.h b/vm_opts.h index 02d60e7..b0ca81f 100644 --- a/vm_opts.h +++ b/vm_opts.h @@ -62,6 +62,10 @@ https://github.com/ruby/ruby/blob/trunk/vm_opts.h#L62 #define OPT_SUPPORT_JOKE 0 #endif +#ifndef OPT_SUPPORT_CALL_C_FUNCTION +#define OPT_SUPPORT_CALL_C_FUNCTION 0 +#endif + #ifndef VM_COLLECT_USAGE_DETAILS #define VM_COLLECT_USAGE_DETAILS 0 #endif -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/