mirror of
https://github.com/ruby/ruby.git
synced 2025-08-27 06:56:13 +02:00
Fix invokebuiltin in Ruby MJIT
45fe7f7575/tool/ruby_vm/views/_mjit_compile_invokebuiltin.erb (L21)
has not been ported correctly.
This commit is contained in:
parent
3dd4e381fe
commit
96d29dff66
2 changed files with 11 additions and 4 deletions
|
@ -24,9 +24,6 @@ class TestMJIT < Test::Unit::TestCase
|
|||
# not supported yet
|
||||
:defineclass,
|
||||
|
||||
# to be tested
|
||||
:invokebuiltin,
|
||||
|
||||
# never used
|
||||
:opt_invokebuiltin_delegate,
|
||||
].each do |insn|
|
||||
|
@ -600,6 +597,15 @@ class TestMJIT < Test::Unit::TestCase
|
|||
assert_compile_once("'true' =~ /true/", result_inspect: '0', insns: %i[opt_regexpmatch2])
|
||||
end
|
||||
|
||||
def test_compile_insn_invokebuiltin
|
||||
iseq = eval(EnvUtil.invoke_ruby(['-e', <<~'EOS'], '', true).first)
|
||||
p RubyVM::InstructionSequence.of([].method(:sample)).to_a
|
||||
EOS
|
||||
insns = collect_insns(iseq)
|
||||
mark_tested_insn(:invokebuiltin, used_insns: insns)
|
||||
assert_eval_with_jit('print [].sample(1)', stdout: '[]', success_count: 1)
|
||||
end
|
||||
|
||||
def test_compile_insn_opt_invokebuiltin_delegate_leave
|
||||
iseq = eval(EnvUtil.invoke_ruby(['-e', <<~'EOS'], '', true).first)
|
||||
p RubyVM::InstructionSequence.of("\x00".method(:unpack)).to_a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue