1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Collect insns from a child process

to make sure :opt_invokebuiltin_delegate_leave doesn't become
:(trace_)opt_invokebuiltin_delegate.

This is to prevent a warning like
> /tmp/ruby/v3/src/trunk-test/test/ruby/test_jit.rb:618: warning:
'opt_invokebuiltin_delegate_leave' insn is not included in the script.
Actual insns are: opt_invokebuiltin_delegate leave
This commit is contained in:
Takashi Kokubun 2020-06-25 22:21:12 -07:00
parent a640bcee04
commit 9dbc2294a6
No known key found for this signature in database
GPG key ID: 6FFC433B12EE23DD

View file

@ -614,7 +614,10 @@ class TestJIT < Test::Unit::TestCase
def test_compile_insn_opt_invokebuiltin_delegate_leave
skip 'ld SEGVs for this' if RUBY_PLATFORM.start_with?("s390x-")
insns = collect_insns(RubyVM::InstructionSequence.of("\x00".method(:unpack)).to_a)
iseq = eval(EnvUtil.invoke_ruby(['-e', <<~'EOS'], '', true).first)
p RubyVM::InstructionSequence.of("\x00".method(:unpack)).to_a
EOS
insns = collect_insns(iseq)
mark_tested_insn(:opt_invokebuiltin_delegate_leave, used_insns: insns)
assert_eval_with_jit('print "\x00".unpack("c")', stdout: '[0]', success_count: 1)
end