mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Rename RubyVM::MJIT to RubyVM::JIT
because the name "MJIT" is an internal code name, it's inconsistent with --jit while they are related to each other, and I want to discourage future JIT implementation-specific (e.g. MJIT-specific) APIs by this rename. [Feature #17490]
This commit is contained in:
parent
4d13f3e9da
commit
e1fee7f949
34 changed files with 86 additions and 81 deletions
2
NEWS.md
2
NEWS.md
|
@ -37,6 +37,8 @@ Excluding feature bug fixes.
|
||||||
|
|
||||||
### JIT
|
### JIT
|
||||||
|
|
||||||
|
* `RubyVM::MJIT` is renamed to `RubyVM::JIT`.
|
||||||
|
|
||||||
## Static analysis
|
## Static analysis
|
||||||
|
|
||||||
### RBS
|
### RBS
|
||||||
|
|
|
@ -14,17 +14,17 @@ class BenchmarkDriver::Runner::Mjit < BenchmarkDriver::Runner::Ips
|
||||||
jobs.map do |job|
|
jobs.map do |job|
|
||||||
job = job.dup
|
job = job.dup
|
||||||
job.prelude = "#{job.prelude}\n#{<<~EOS}"
|
job.prelude = "#{job.prelude}\n#{<<~EOS}"
|
||||||
if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
|
if defined?(RubyVM::JIT) && RubyVM::JIT.enabled?
|
||||||
__bmdv_ruby_i = 0
|
__bmdv_ruby_i = 0
|
||||||
while __bmdv_ruby_i < 10000 # jit_min_calls
|
while __bmdv_ruby_i < 10000 # jit_min_calls
|
||||||
#{job.script}
|
#{job.script}
|
||||||
__bmdv_ruby_i += 1
|
__bmdv_ruby_i += 1
|
||||||
end
|
end
|
||||||
RubyVM::MJIT.pause # compile
|
RubyVM::JIT.pause # compile
|
||||||
#{job.script}
|
#{job.script}
|
||||||
RubyVM::MJIT.resume; RubyVM::MJIT.pause # recompile
|
RubyVM::JIT.resume; RubyVM::JIT.pause # recompile
|
||||||
#{job.script}
|
#{job.script}
|
||||||
RubyVM::MJIT.resume; RubyVM::MJIT.pause # recompile 2
|
RubyVM::JIT.resume; RubyVM::JIT.pause # recompile 2
|
||||||
end
|
end
|
||||||
EOS
|
EOS
|
||||||
job
|
job
|
||||||
|
|
|
@ -135,7 +135,7 @@ class BenchmarkDriver::Runner::MjitExec
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
% end
|
% end
|
||||||
RubyVM::MJIT.pause if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
|
RubyVM::JIT.pause if defined?(RubyVM::JIT) && RubyVM::JIT.enabled?
|
||||||
|
|
||||||
def vm
|
def vm
|
||||||
t = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
t = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
||||||
|
@ -172,7 +172,7 @@ class BenchmarkDriver::Runner::MjitExec
|
||||||
a<%= i %>
|
a<%= i %>
|
||||||
a<%= i %> # --jit-min-calls=2
|
a<%= i %> # --jit-min-calls=2
|
||||||
% end
|
% end
|
||||||
RubyVM::MJIT.pause if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
|
RubyVM::JIT.pause if defined?(RubyVM::JIT) && RubyVM::JIT.enabled?
|
||||||
|
|
||||||
def vm
|
def vm
|
||||||
t = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
t = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
||||||
|
@ -228,7 +228,7 @@ class BenchmarkDriver::Runner::MjitExec
|
||||||
|
|
||||||
jit
|
jit
|
||||||
jit
|
jit
|
||||||
RubyVM::MJIT.pause if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
|
RubyVM::JIT.pause if defined?(RubyVM::JIT) && RubyVM::JIT.enabled?
|
||||||
File.write(<%= result.dump %>, jit)
|
File.write(<%= result.dump %>, jit)
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
|
@ -383,7 +383,7 @@ def assert_normal_exit(testsrc, *rest, timeout: nil, **opt)
|
||||||
end
|
end
|
||||||
|
|
||||||
def assert_finish(timeout_seconds, testsrc, message = '')
|
def assert_finish(timeout_seconds, testsrc, message = '')
|
||||||
if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # for --jit-wait
|
if defined?(RubyVM::JIT) && RubyVM::JIT.enabled? # for --jit-wait
|
||||||
timeout_seconds *= 3
|
timeout_seconds *= 3
|
||||||
end
|
end
|
||||||
newtest
|
newtest
|
||||||
|
|
|
@ -23,7 +23,7 @@ describe "IO#flush" do
|
||||||
# For instance, MJIT creates a worker before @r.close with fork(), @r.close happens,
|
# For instance, MJIT creates a worker before @r.close with fork(), @r.close happens,
|
||||||
# and the MJIT worker keeps the pipe open until the worker execve().
|
# and the MJIT worker keeps the pipe open until the worker execve().
|
||||||
# TODO: consider acquiring GVL from MJIT worker.
|
# TODO: consider acquiring GVL from MJIT worker.
|
||||||
guard_not -> { defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? } do
|
guard_not -> { defined?(RubyVM::JIT) && RubyVM::JIT.enabled? } do
|
||||||
it "raises Errno::EPIPE if sync=false and the read end is closed" do
|
it "raises Errno::EPIPE if sync=false and the read end is closed" do
|
||||||
@w.sync = false
|
@w.sync = false
|
||||||
@w.write "foo"
|
@w.write "foo"
|
||||||
|
|
|
@ -99,7 +99,7 @@ describe :io_write, shared: true do
|
||||||
# For instance, MJIT creates a worker before @r.close with fork(), @r.close happens,
|
# For instance, MJIT creates a worker before @r.close with fork(), @r.close happens,
|
||||||
# and the MJIT worker keeps the pipe open until the worker execve().
|
# and the MJIT worker keeps the pipe open until the worker execve().
|
||||||
# TODO: consider acquiring GVL from MJIT worker.
|
# TODO: consider acquiring GVL from MJIT worker.
|
||||||
guard_not -> { defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? } do
|
guard_not -> { defined?(RubyVM::JIT) && RubyVM::JIT.enabled? } do
|
||||||
it "raises Errno::EPIPE if the read end is closed and does not die from SIGPIPE" do
|
it "raises Errno::EPIPE if the read end is closed and does not die from SIGPIPE" do
|
||||||
@r.close
|
@r.close
|
||||||
-> { @w.send(@method, "foo") }.should raise_error(Errno::EPIPE, /Broken pipe/)
|
-> { @w.send(@method, "foo") }.should raise_error(Errno::EPIPE, /Broken pipe/)
|
||||||
|
|
|
@ -32,7 +32,7 @@ class Object
|
||||||
CROSS_COMPILING = RUBY_PLATFORM
|
CROSS_COMPILING = RUBY_PLATFORM
|
||||||
constants.grep(/^RUBY_/) {|n| remove_const n}
|
constants.grep(/^RUBY_/) {|n| remove_const n}
|
||||||
% arg['versions'].each {|n, v|
|
% arg['versions'].each {|n, v|
|
||||||
<%=n%> = <%if n=='RUBY_DESCRIPTION' %>RubyVM.const_defined?(:MJIT) && RubyVM::MJIT.enabled? ?
|
<%=n%> = <%if n=='RUBY_DESCRIPTION' %>RubyVM.const_defined?(:JIT) && RubyVM::JIT.enabled? ?
|
||||||
<%=arg['RUBY_DESCRIPTION_WITH_JIT'].inspect%> :
|
<%=arg['RUBY_DESCRIPTION_WITH_JIT'].inspect%> :
|
||||||
<%end%><%=v.inspect%>
|
<%end%><%=v.inspect%>
|
||||||
% }
|
% }
|
||||||
|
|
|
@ -7,7 +7,7 @@ class TestBugReporter < Test::Unit::TestCase
|
||||||
skip if ENV['RUBY_ON_BUG']
|
skip if ENV['RUBY_ON_BUG']
|
||||||
|
|
||||||
description = RUBY_DESCRIPTION
|
description = RUBY_DESCRIPTION
|
||||||
description = description.sub(/\+JIT /, '') if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
|
description = description.sub(/\+JIT /, '') if defined?(RubyVM::JIT) && RubyVM::JIT.enabled?
|
||||||
expected_stderr = [
|
expected_stderr = [
|
||||||
:*,
|
:*,
|
||||||
/\[BUG\]\sSegmentation\sfault.*\n/,
|
/\[BUG\]\sSegmentation\sfault.*\n/,
|
||||||
|
|
|
@ -247,7 +247,7 @@ line,5,jkl
|
||||||
def assert_parse_errors_out(data, **options)
|
def assert_parse_errors_out(data, **options)
|
||||||
assert_raise(CSV::MalformedCSVError) do
|
assert_raise(CSV::MalformedCSVError) do
|
||||||
timeout = 0.2
|
timeout = 0.2
|
||||||
if defined?(RubyVM::MJIT.enabled?) and RubyVM::MJIT.enabled?
|
if defined?(RubyVM::JIT.enabled?) and RubyVM::JIT.enabled?
|
||||||
timeout = 5 # for --jit-wait
|
timeout = 5 # for --jit-wait
|
||||||
end
|
end
|
||||||
Timeout.timeout(timeout) do
|
Timeout.timeout(timeout) do
|
||||||
|
|
|
@ -216,7 +216,7 @@ module DRbCore
|
||||||
def test_06_timeout
|
def test_06_timeout
|
||||||
skip if RUBY_PLATFORM.include?("armv7l-linux")
|
skip if RUBY_PLATFORM.include?("armv7l-linux")
|
||||||
skip if RUBY_PLATFORM.include?("sparc-solaris2.10")
|
skip if RUBY_PLATFORM.include?("sparc-solaris2.10")
|
||||||
skip if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # expecting a certain delay is difficult for --jit-wait CI
|
skip if defined?(RubyVM::JIT) && RubyVM::JIT.enabled? # expecting a certain delay is difficult for --jit-wait CI
|
||||||
Timeout.timeout(60) do
|
Timeout.timeout(60) do
|
||||||
ten = Onecky.new(10)
|
ten = Onecky.new(10)
|
||||||
assert_raise(Timeout::Error) do
|
assert_raise(Timeout::Error) do
|
||||||
|
|
|
@ -74,7 +74,7 @@ module JITSupport
|
||||||
end
|
end
|
||||||
|
|
||||||
def remove_mjit_logs(stderr)
|
def remove_mjit_logs(stderr)
|
||||||
if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # utility for -DFORCE_MJIT_ENABLE
|
if defined?(RubyVM::JIT) && RubyVM::JIT.enabled? # utility for -DFORCE_MJIT_ENABLE
|
||||||
stderr.gsub(/^MJIT warning: Skipped to compile unsupported instruction: \w+\n/m, '')
|
stderr.gsub(/^MJIT warning: Skipped to compile unsupported instruction: \w+\n/m, '')
|
||||||
else
|
else
|
||||||
stderr
|
stderr
|
||||||
|
|
|
@ -762,7 +762,7 @@ class FTPTest < Test::Unit::TestCase
|
||||||
begin
|
begin
|
||||||
begin
|
begin
|
||||||
ftp = Net::FTP.new
|
ftp = Net::FTP.new
|
||||||
ftp.read_timeout *= 5 if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # for --jit-wait
|
ftp.read_timeout *= 5 if defined?(RubyVM::JIT) && RubyVM::JIT.enabled? # for --jit-wait
|
||||||
ftp.connect(SERVER_ADDR, server.port)
|
ftp.connect(SERVER_ADDR, server.port)
|
||||||
ftp.login
|
ftp.login
|
||||||
assert_match(/\AUSER /, commands.shift)
|
assert_match(/\AUSER /, commands.shift)
|
||||||
|
@ -807,7 +807,7 @@ class FTPTest < Test::Unit::TestCase
|
||||||
begin
|
begin
|
||||||
begin
|
begin
|
||||||
ftp = Net::FTP.new
|
ftp = Net::FTP.new
|
||||||
ftp.read_timeout *= 5 if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # for --jit-wait
|
ftp.read_timeout *= 5 if defined?(RubyVM::JIT) && RubyVM::JIT.enabled? # for --jit-wait
|
||||||
ftp.connect(SERVER_ADDR, server.port)
|
ftp.connect(SERVER_ADDR, server.port)
|
||||||
ftp.login
|
ftp.login
|
||||||
assert_match(/\AUSER /, commands.shift)
|
assert_match(/\AUSER /, commands.shift)
|
||||||
|
@ -1545,7 +1545,7 @@ EOF
|
||||||
begin
|
begin
|
||||||
begin
|
begin
|
||||||
ftp = Net::FTP.new
|
ftp = Net::FTP.new
|
||||||
ftp.read_timeout *= 5 if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # for --jit-wait
|
ftp.read_timeout *= 5 if defined?(RubyVM::JIT) && RubyVM::JIT.enabled? # for --jit-wait
|
||||||
ftp.connect(SERVER_ADDR, server.port)
|
ftp.connect(SERVER_ADDR, server.port)
|
||||||
assert_equal(['LANG EN*', 'UTF8'], ftp.features)
|
assert_equal(['LANG EN*', 'UTF8'], ftp.features)
|
||||||
assert_equal("FEAT\r\n", commands.shift)
|
assert_equal("FEAT\r\n", commands.shift)
|
||||||
|
@ -1568,7 +1568,7 @@ EOF
|
||||||
begin
|
begin
|
||||||
begin
|
begin
|
||||||
ftp = Net::FTP.new
|
ftp = Net::FTP.new
|
||||||
ftp.read_timeout *= 5 if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # for --jit-wait
|
ftp.read_timeout *= 5 if defined?(RubyVM::JIT) && RubyVM::JIT.enabled? # for --jit-wait
|
||||||
ftp.connect(SERVER_ADDR, server.port)
|
ftp.connect(SERVER_ADDR, server.port)
|
||||||
assert_raise(Net::FTPPermError) do
|
assert_raise(Net::FTPPermError) do
|
||||||
ftp.features
|
ftp.features
|
||||||
|
@ -1594,7 +1594,7 @@ EOF
|
||||||
begin
|
begin
|
||||||
begin
|
begin
|
||||||
ftp = Net::FTP.new
|
ftp = Net::FTP.new
|
||||||
ftp.read_timeout *= 5 if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # for --jit-wait
|
ftp.read_timeout *= 5 if defined?(RubyVM::JIT) && RubyVM::JIT.enabled? # for --jit-wait
|
||||||
ftp.connect(SERVER_ADDR, server.port)
|
ftp.connect(SERVER_ADDR, server.port)
|
||||||
ftp.option("UTF8", "ON")
|
ftp.option("UTF8", "ON")
|
||||||
assert_equal("OPTS UTF8 ON\r\n", commands.shift)
|
assert_equal("OPTS UTF8 ON\r\n", commands.shift)
|
||||||
|
@ -1653,7 +1653,7 @@ EOF
|
||||||
begin
|
begin
|
||||||
begin
|
begin
|
||||||
ftp = Net::FTP.new
|
ftp = Net::FTP.new
|
||||||
ftp.read_timeout *= 5 if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # for --jit-wait
|
ftp.read_timeout *= 5 if defined?(RubyVM::JIT) && RubyVM::JIT.enabled? # for --jit-wait
|
||||||
ftp.connect(SERVER_ADDR, server.port)
|
ftp.connect(SERVER_ADDR, server.port)
|
||||||
entry = ftp.mlst("foo")
|
entry = ftp.mlst("foo")
|
||||||
assert_equal("/foo", entry.pathname)
|
assert_equal("/foo", entry.pathname)
|
||||||
|
@ -1740,7 +1740,7 @@ EOF
|
||||||
begin
|
begin
|
||||||
begin
|
begin
|
||||||
ftp = Net::FTP.new
|
ftp = Net::FTP.new
|
||||||
ftp.read_timeout *= 5 if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # for --jit-wait
|
ftp.read_timeout *= 5 if defined?(RubyVM::JIT) && RubyVM::JIT.enabled? # for --jit-wait
|
||||||
ftp.connect(SERVER_ADDR, server.port)
|
ftp.connect(SERVER_ADDR, server.port)
|
||||||
ftp.login
|
ftp.login
|
||||||
assert_match(/\AUSER /, commands.shift)
|
assert_match(/\AUSER /, commands.shift)
|
||||||
|
@ -1779,7 +1779,7 @@ EOF
|
||||||
|
|
||||||
def test_parse257
|
def test_parse257
|
||||||
ftp = Net::FTP.new
|
ftp = Net::FTP.new
|
||||||
ftp.read_timeout *= 5 if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # for --jit-wait
|
ftp.read_timeout *= 5 if defined?(RubyVM::JIT) && RubyVM::JIT.enabled? # for --jit-wait
|
||||||
assert_equal('/foo/bar',
|
assert_equal('/foo/bar',
|
||||||
ftp.send(:parse257, '257 "/foo/bar" directory created'))
|
ftp.send(:parse257, '257 "/foo/bar" directory created'))
|
||||||
assert_equal('/foo/bar"baz',
|
assert_equal('/foo/bar"baz',
|
||||||
|
@ -1918,7 +1918,7 @@ EOF
|
||||||
port: port,
|
port: port,
|
||||||
ssl: { ca_file: CA_FILE },
|
ssl: { ca_file: CA_FILE },
|
||||||
passive: false)
|
passive: false)
|
||||||
ftp.read_timeout *= 5 if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # for --jit-wait
|
ftp.read_timeout *= 5 if defined?(RubyVM::JIT) && RubyVM::JIT.enabled? # for --jit-wait
|
||||||
begin
|
begin
|
||||||
assert_equal("AUTH TLS\r\n", commands.shift)
|
assert_equal("AUTH TLS\r\n", commands.shift)
|
||||||
assert_equal("PBSZ 0\r\n", commands.shift)
|
assert_equal("PBSZ 0\r\n", commands.shift)
|
||||||
|
@ -2003,7 +2003,7 @@ EOF
|
||||||
port: port,
|
port: port,
|
||||||
ssl: { ca_file: CA_FILE },
|
ssl: { ca_file: CA_FILE },
|
||||||
passive: true)
|
passive: true)
|
||||||
ftp.read_timeout *= 5 if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # for --jit-wait
|
ftp.read_timeout *= 5 if defined?(RubyVM::JIT) && RubyVM::JIT.enabled? # for --jit-wait
|
||||||
begin
|
begin
|
||||||
assert_equal("AUTH TLS\r\n", commands.shift)
|
assert_equal("AUTH TLS\r\n", commands.shift)
|
||||||
assert_equal("PBSZ 0\r\n", commands.shift)
|
assert_equal("PBSZ 0\r\n", commands.shift)
|
||||||
|
@ -2079,7 +2079,7 @@ EOF
|
||||||
ssl: { ca_file: CA_FILE },
|
ssl: { ca_file: CA_FILE },
|
||||||
private_data_connection: false,
|
private_data_connection: false,
|
||||||
passive: false)
|
passive: false)
|
||||||
ftp.read_timeout *= 5 if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # for --jit-wait
|
ftp.read_timeout *= 5 if defined?(RubyVM::JIT) && RubyVM::JIT.enabled? # for --jit-wait
|
||||||
begin
|
begin
|
||||||
assert_equal("AUTH TLS\r\n", commands.shift)
|
assert_equal("AUTH TLS\r\n", commands.shift)
|
||||||
ftp.login
|
ftp.login
|
||||||
|
@ -2149,7 +2149,7 @@ EOF
|
||||||
ssl: { ca_file: CA_FILE },
|
ssl: { ca_file: CA_FILE },
|
||||||
private_data_connection: false,
|
private_data_connection: false,
|
||||||
passive: true)
|
passive: true)
|
||||||
ftp.read_timeout *= 5 if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # for --jit-wait
|
ftp.read_timeout *= 5 if defined?(RubyVM::JIT) && RubyVM::JIT.enabled? # for --jit-wait
|
||||||
begin
|
begin
|
||||||
assert_equal("AUTH TLS\r\n", commands.shift)
|
assert_equal("AUTH TLS\r\n", commands.shift)
|
||||||
ftp.login
|
ftp.login
|
||||||
|
@ -2230,7 +2230,7 @@ EOF
|
||||||
ftp = Net::FTP.new(SERVER_NAME,
|
ftp = Net::FTP.new(SERVER_NAME,
|
||||||
port: server.port,
|
port: server.port,
|
||||||
ssl: { ca_file: CA_FILE })
|
ssl: { ca_file: CA_FILE })
|
||||||
ftp.read_timeout *= 5 if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # for --jit-wait
|
ftp.read_timeout *= 5 if defined?(RubyVM::JIT) && RubyVM::JIT.enabled? # for --jit-wait
|
||||||
assert_equal("AUTH TLS\r\n", commands.shift)
|
assert_equal("AUTH TLS\r\n", commands.shift)
|
||||||
assert_equal("PBSZ 0\r\n", commands.shift)
|
assert_equal("PBSZ 0\r\n", commands.shift)
|
||||||
assert_equal("PROT P\r\n", commands.shift)
|
assert_equal("PROT P\r\n", commands.shift)
|
||||||
|
@ -2283,7 +2283,7 @@ EOF
|
||||||
begin
|
begin
|
||||||
ftp = Net::FTP.new
|
ftp = Net::FTP.new
|
||||||
ftp.resume = resume
|
ftp.resume = resume
|
||||||
ftp.read_timeout = (defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?) ? 300 : 0.2 # use large timeout for --jit-wait
|
ftp.read_timeout = (defined?(RubyVM::JIT) && RubyVM::JIT.enabled?) ? 300 : 0.2 # use large timeout for --jit-wait
|
||||||
ftp.connect(SERVER_ADDR, server.port)
|
ftp.connect(SERVER_ADDR, server.port)
|
||||||
ftp.login
|
ftp.login
|
||||||
assert_match(/\AUSER /, commands.shift)
|
assert_match(/\AUSER /, commands.shift)
|
||||||
|
@ -2342,7 +2342,7 @@ EOF
|
||||||
chdir_to_tmpdir do
|
chdir_to_tmpdir do
|
||||||
begin
|
begin
|
||||||
ftp = Net::FTP.new
|
ftp = Net::FTP.new
|
||||||
ftp.read_timeout *= 5 if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # for --jit-wait
|
ftp.read_timeout *= 5 if defined?(RubyVM::JIT) && RubyVM::JIT.enabled? # for --jit-wait
|
||||||
ftp.connect(SERVER_ADDR, server.port)
|
ftp.connect(SERVER_ADDR, server.port)
|
||||||
ftp.login
|
ftp.login
|
||||||
assert_match(/\AUSER /, commands.shift)
|
assert_match(/\AUSER /, commands.shift)
|
||||||
|
@ -2393,7 +2393,7 @@ EOF
|
||||||
File.binwrite("./|echo hello", binary_data)
|
File.binwrite("./|echo hello", binary_data)
|
||||||
begin
|
begin
|
||||||
ftp = Net::FTP.new
|
ftp = Net::FTP.new
|
||||||
ftp.read_timeout = RubyVM::MJIT.enabled? ? 300 : 0.2 # use large timeout for --jit-wait
|
ftp.read_timeout = RubyVM::JIT.enabled? ? 300 : 0.2 # use large timeout for --jit-wait
|
||||||
ftp.connect(SERVER_ADDR, server.port)
|
ftp.connect(SERVER_ADDR, server.port)
|
||||||
ftp.login
|
ftp.login
|
||||||
assert_match(/\AUSER /, commands.shift)
|
assert_match(/\AUSER /, commands.shift)
|
||||||
|
@ -2448,7 +2448,7 @@ EOF
|
||||||
end
|
end
|
||||||
begin
|
begin
|
||||||
ftp = Net::FTP.new
|
ftp = Net::FTP.new
|
||||||
ftp.read_timeout *= 5 if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # for --jit-wait
|
ftp.read_timeout *= 5 if defined?(RubyVM::JIT) && RubyVM::JIT.enabled? # for --jit-wait
|
||||||
ftp.connect(SERVER_ADDR, server.port)
|
ftp.connect(SERVER_ADDR, server.port)
|
||||||
ftp.login
|
ftp.login
|
||||||
assert_match(/\AUSER /, commands.shift)
|
assert_match(/\AUSER /, commands.shift)
|
||||||
|
|
|
@ -78,7 +78,7 @@ EOS
|
||||||
|
|
||||||
def test_read_body_block_mod
|
def test_read_body_block_mod
|
||||||
# http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/3019353
|
# http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/3019353
|
||||||
skip 'too unstable with --jit-wait, and extending read_timeout did not help it' if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
|
skip 'too unstable with --jit-wait, and extending read_timeout did not help it' if defined?(RubyVM::JIT) && RubyVM::JIT.enabled?
|
||||||
IO.pipe do |r, w|
|
IO.pipe do |r, w|
|
||||||
buf = 'x' * 1024
|
buf = 'x' * 1024
|
||||||
buf.freeze
|
buf.freeze
|
||||||
|
|
|
@ -31,7 +31,7 @@ module Net
|
||||||
def setup
|
def setup
|
||||||
# Avoid hanging at fake_server_start's IO.select on --jit-wait CI like http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3302796
|
# Avoid hanging at fake_server_start's IO.select on --jit-wait CI like http://ci.rvm.jp/results/trunk-mjit-wait@phosphorus-docker/3302796
|
||||||
# Unfortunately there's no way to configure read_timeout for Net::SMTP.start.
|
# Unfortunately there's no way to configure read_timeout for Net::SMTP.start.
|
||||||
if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
|
if defined?(RubyVM::JIT) && RubyVM::JIT.enabled?
|
||||||
Net::SMTP.prepend Module.new {
|
Net::SMTP.prepend Module.new {
|
||||||
def initialize(*)
|
def initialize(*)
|
||||||
super
|
super
|
||||||
|
|
|
@ -8,7 +8,7 @@ class Reline::WithinPipeTest < Reline::TestCase
|
||||||
@reader, @output_writer = IO.pipe((RELINE_TEST_ENCODING rescue Encoding.default_external))
|
@reader, @output_writer = IO.pipe((RELINE_TEST_ENCODING rescue Encoding.default_external))
|
||||||
@output = Reline.output = @output_writer
|
@output = Reline.output = @output_writer
|
||||||
@config = Reline.send(:core).config
|
@config = Reline.send(:core).config
|
||||||
@config.keyseq_timeout *= 600 if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # for --jit-wait CI
|
@config.keyseq_timeout *= 600 if defined?(RubyVM::JIT) && RubyVM::JIT.enabled? # for --jit-wait CI
|
||||||
@line_editor = Reline.send(:core).line_editor
|
@line_editor = Reline.send(:core).line_editor
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -402,7 +402,7 @@ module TupleSpaceTestModule
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_cancel_02
|
def test_cancel_02
|
||||||
skip 'this test is unstable with --jit-wait' if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
|
skip 'this test is unstable with --jit-wait' if defined?(RubyVM::JIT) && RubyVM::JIT.enabled?
|
||||||
entry = @ts.write([:removeme, 1])
|
entry = @ts.write([:removeme, 1])
|
||||||
assert_equal([[:removeme, 1]], @ts.read_all([nil, nil]))
|
assert_equal([[:removeme, 1]], @ts.read_all([nil, nil]))
|
||||||
entry.cancel
|
entry.cancel
|
||||||
|
@ -662,7 +662,7 @@ class TestRingServer < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_do_reply_local
|
def test_do_reply_local
|
||||||
skip 'timeout-based test becomes unstable with --jit-wait' if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
|
skip 'timeout-based test becomes unstable with --jit-wait' if defined?(RubyVM::JIT) && RubyVM::JIT.enabled?
|
||||||
with_timeout(30) {_test_do_reply_local}
|
with_timeout(30) {_test_do_reply_local}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ class TestFiber < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_many_fibers
|
def test_many_fibers
|
||||||
skip 'This is unstable on GitHub Actions --jit-wait. TODO: debug it' if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
|
skip 'This is unstable on GitHub Actions --jit-wait. TODO: debug it' if defined?(RubyVM::JIT) && RubyVM::JIT.enabled?
|
||||||
max = 10_000
|
max = 10_000
|
||||||
assert_equal(max, max.times{
|
assert_equal(max, max.times{
|
||||||
Fiber.new{}
|
Fiber.new{}
|
||||||
|
|
|
@ -607,7 +607,7 @@ class TestIO < Test::Unit::TestCase
|
||||||
|
|
||||||
if have_nonblock?
|
if have_nonblock?
|
||||||
def test_copy_stream_no_busy_wait
|
def test_copy_stream_no_busy_wait
|
||||||
skip "MJIT has busy wait on GC. This sometimes fails with --jit." if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
|
skip "MJIT has busy wait on GC. This sometimes fails with --jit." if defined?(RubyVM::JIT) && RubyVM::JIT.enabled?
|
||||||
skip "multiple threads already active" if Thread.list.size > 1
|
skip "multiple threads already active" if Thread.list.size > 1
|
||||||
|
|
||||||
msg = 'r58534 [ruby-core:80969] [Backport #13533]'
|
msg = 'r58534 [ruby-core:80969] [Backport #13533]'
|
||||||
|
@ -1562,7 +1562,7 @@ class TestIO < Test::Unit::TestCase
|
||||||
end if have_nonblock?
|
end if have_nonblock?
|
||||||
|
|
||||||
def test_read_nonblock_no_exceptions
|
def test_read_nonblock_no_exceptions
|
||||||
skip '[ruby-core:90895] MJIT worker may leave fd open in a forked child' if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # TODO: consider acquiring GVL from MJIT worker.
|
skip '[ruby-core:90895] MJIT worker may leave fd open in a forked child' if defined?(RubyVM::JIT) && RubyVM::JIT.enabled? # TODO: consider acquiring GVL from MJIT worker.
|
||||||
with_pipe {|r, w|
|
with_pipe {|r, w|
|
||||||
assert_equal :wait_readable, r.read_nonblock(4096, exception: false)
|
assert_equal :wait_readable, r.read_nonblock(4096, exception: false)
|
||||||
w.puts "HI!"
|
w.puts "HI!"
|
||||||
|
@ -2210,7 +2210,7 @@ class TestIO < Test::Unit::TestCase
|
||||||
def test_autoclose_true_closed_by_finalizer
|
def test_autoclose_true_closed_by_finalizer
|
||||||
# http://ci.rvm.jp/results/trunk-mjit@silicon-docker/1465760
|
# http://ci.rvm.jp/results/trunk-mjit@silicon-docker/1465760
|
||||||
# http://ci.rvm.jp/results/trunk-mjit@silicon-docker/1469765
|
# http://ci.rvm.jp/results/trunk-mjit@silicon-docker/1469765
|
||||||
skip 'this randomly fails with MJIT' if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
|
skip 'this randomly fails with MJIT' if defined?(RubyVM::JIT) && RubyVM::JIT.enabled?
|
||||||
|
|
||||||
feature2250 = '[ruby-core:26222]'
|
feature2250 = '[ruby-core:26222]'
|
||||||
pre = 'ft2250'
|
pre = 'ft2250'
|
||||||
|
|
|
@ -1085,7 +1085,7 @@ class TestJIT < Test::Unit::TestCase
|
||||||
def test_mjit_pause_wait
|
def test_mjit_pause_wait
|
||||||
assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: '', success_count: 0, min_calls: 1)
|
assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: '', success_count: 0, min_calls: 1)
|
||||||
begin;
|
begin;
|
||||||
RubyVM::MJIT.pause
|
RubyVM::JIT.pause
|
||||||
proc {}.call
|
proc {}.call
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
|
|
|
@ -452,7 +452,7 @@ class TestRubyOptimization < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_tailcall_not_to_grow_stack
|
def test_tailcall_not_to_grow_stack
|
||||||
skip 'currently JIT-ed code always creates a new stack frame' if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
|
skip 'currently JIT-ed code always creates a new stack frame' if defined?(RubyVM::JIT) && RubyVM::JIT.enabled?
|
||||||
bug16161 = '[ruby-core:94881]'
|
bug16161 = '[ruby-core:94881]'
|
||||||
|
|
||||||
tailcall("#{<<-"begin;"}\n#{<<~"end;"}")
|
tailcall("#{<<-"begin;"}\n#{<<~"end;"}")
|
||||||
|
|
|
@ -1706,7 +1706,7 @@ class TestProcess < Test::Unit::TestCase
|
||||||
Process.wait pid
|
Process.wait pid
|
||||||
assert_send [sig_r, :wait_readable, 5], 'self-pipe not readable'
|
assert_send [sig_r, :wait_readable, 5], 'self-pipe not readable'
|
||||||
end
|
end
|
||||||
if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # checking -DMJIT_FORCE_ENABLE. It may trigger extra SIGCHLD.
|
if defined?(RubyVM::JIT) && RubyVM::JIT.enabled? # checking -DMJIT_FORCE_ENABLE. It may trigger extra SIGCHLD.
|
||||||
assert_equal [true], signal_received.uniq, "[ruby-core:19744]"
|
assert_equal [true], signal_received.uniq, "[ruby-core:19744]"
|
||||||
else
|
else
|
||||||
assert_equal [true], signal_received, "[ruby-core:19744]"
|
assert_equal [true], signal_received, "[ruby-core:19744]"
|
||||||
|
|
|
@ -8,7 +8,7 @@ require_relative '../lib/jit_support'
|
||||||
|
|
||||||
class TestRubyOptions < Test::Unit::TestCase
|
class TestRubyOptions < Test::Unit::TestCase
|
||||||
NO_JIT_DESCRIPTION =
|
NO_JIT_DESCRIPTION =
|
||||||
if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # checking -DMJIT_FORCE_ENABLE
|
if defined?(RubyVM::JIT) && RubyVM::JIT.enabled? # checking -DMJIT_FORCE_ENABLE
|
||||||
RUBY_DESCRIPTION.sub(/\+JIT /, '')
|
RUBY_DESCRIPTION.sub(/\+JIT /, '')
|
||||||
else
|
else
|
||||||
RUBY_DESCRIPTION
|
RUBY_DESCRIPTION
|
||||||
|
@ -128,7 +128,7 @@ class TestRubyOptions < Test::Unit::TestCase
|
||||||
def test_verbose
|
def test_verbose
|
||||||
assert_in_out_err(["-vve", ""]) do |r, e|
|
assert_in_out_err(["-vve", ""]) do |r, e|
|
||||||
assert_match(VERSION_PATTERN, r[0])
|
assert_match(VERSION_PATTERN, r[0])
|
||||||
if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? && !mjit_force_enabled? # checking -DMJIT_FORCE_ENABLE
|
if defined?(RubyVM::JIT) && RubyVM::JIT.enabled? && !mjit_force_enabled? # checking -DMJIT_FORCE_ENABLE
|
||||||
assert_equal(NO_JIT_DESCRIPTION, r[0])
|
assert_equal(NO_JIT_DESCRIPTION, r[0])
|
||||||
else
|
else
|
||||||
assert_equal(RUBY_DESCRIPTION, r[0])
|
assert_equal(RUBY_DESCRIPTION, r[0])
|
||||||
|
@ -191,7 +191,7 @@ class TestRubyOptions < Test::Unit::TestCase
|
||||||
def test_version
|
def test_version
|
||||||
assert_in_out_err(%w(--version)) do |r, e|
|
assert_in_out_err(%w(--version)) do |r, e|
|
||||||
assert_match(VERSION_PATTERN, r[0])
|
assert_match(VERSION_PATTERN, r[0])
|
||||||
if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # checking -DMJIT_FORCE_ENABLE
|
if defined?(RubyVM::JIT) && RubyVM::JIT.enabled? # checking -DMJIT_FORCE_ENABLE
|
||||||
assert_equal(EnvUtil.invoke_ruby(['-e', 'print RUBY_DESCRIPTION'], '', true).first, r[0])
|
assert_equal(EnvUtil.invoke_ruby(['-e', 'print RUBY_DESCRIPTION'], '', true).first, r[0])
|
||||||
else
|
else
|
||||||
assert_equal(RUBY_DESCRIPTION, r[0])
|
assert_equal(RUBY_DESCRIPTION, r[0])
|
||||||
|
@ -221,7 +221,7 @@ class TestRubyOptions < Test::Unit::TestCase
|
||||||
].each do |args|
|
].each do |args|
|
||||||
assert_in_out_err(args) do |r, e|
|
assert_in_out_err(args) do |r, e|
|
||||||
assert_match(VERSION_PATTERN_WITH_JIT, r[0])
|
assert_match(VERSION_PATTERN_WITH_JIT, r[0])
|
||||||
if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # checking -DMJIT_FORCE_ENABLE
|
if defined?(RubyVM::JIT) && RubyVM::JIT.enabled? # checking -DMJIT_FORCE_ENABLE
|
||||||
assert_equal(RUBY_DESCRIPTION, r[0])
|
assert_equal(RUBY_DESCRIPTION, r[0])
|
||||||
else
|
else
|
||||||
assert_equal(EnvUtil.invoke_ruby(['--jit', '-e', 'print RUBY_DESCRIPTION'], '', true).first, r[0])
|
assert_equal(EnvUtil.invoke_ruby(['--jit', '-e', 'print RUBY_DESCRIPTION'], '', true).first, r[0])
|
||||||
|
|
|
@ -4,7 +4,7 @@ require_relative '../lib/jit_support'
|
||||||
|
|
||||||
return if RbConfig::CONFIG["MJIT_SUPPORT"] == 'no'
|
return if RbConfig::CONFIG["MJIT_SUPPORT"] == 'no'
|
||||||
|
|
||||||
class TestRubyVMMJIT < Test::Unit::TestCase
|
class TestRubyVMJIT < Test::Unit::TestCase
|
||||||
include JITSupport
|
include JITSupport
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
|
@ -20,13 +20,13 @@ class TestRubyVMMJIT < Test::Unit::TestCase
|
||||||
eval("def mjit#{i}; end; mjit#{i}")
|
eval("def mjit#{i}; end; mjit#{i}")
|
||||||
i += 1
|
i += 1
|
||||||
end
|
end
|
||||||
print RubyVM::MJIT.pause
|
print RubyVM::JIT.pause
|
||||||
print RubyVM::MJIT.pause
|
print RubyVM::JIT.pause
|
||||||
while i < 10
|
while i < 10
|
||||||
eval("def mjit#{i}; end; mjit#{i}")
|
eval("def mjit#{i}; end; mjit#{i}")
|
||||||
i += 1
|
i += 1
|
||||||
end
|
end
|
||||||
print RubyVM::MJIT.pause # no JIT here
|
print RubyVM::JIT.pause # no JIT here
|
||||||
EOS
|
EOS
|
||||||
assert_equal('truefalsefalse', out)
|
assert_equal('truefalsefalse', out)
|
||||||
assert_equal(
|
assert_equal(
|
||||||
|
@ -39,7 +39,7 @@ class TestRubyVMMJIT < Test::Unit::TestCase
|
||||||
out, err = eval_with_jit(<<~'EOS', verbose: 1, min_calls: 1, wait: false)
|
out, err = eval_with_jit(<<~'EOS', verbose: 1, min_calls: 1, wait: false)
|
||||||
def a() end; a
|
def a() end; a
|
||||||
def b() end; b
|
def b() end; b
|
||||||
RubyVM::MJIT.pause
|
RubyVM::JIT.pause
|
||||||
EOS
|
EOS
|
||||||
assert_equal(
|
assert_equal(
|
||||||
2, err.scan(/#{JITSupport::JIT_SUCCESS_PREFIX}/).size,
|
2, err.scan(/#{JITSupport::JIT_SUCCESS_PREFIX}/).size,
|
||||||
|
@ -58,7 +58,7 @@ class TestRubyVMMJIT < Test::Unit::TestCase
|
||||||
eval("def mjit#{i}; end; mjit#{i}")
|
eval("def mjit#{i}; end; mjit#{i}")
|
||||||
i += 1
|
i += 1
|
||||||
end
|
end
|
||||||
print RubyVM::MJIT.pause
|
print RubyVM::JIT.pause
|
||||||
EOS
|
EOS
|
||||||
assert_equal('true', out)
|
assert_equal('true', out)
|
||||||
end
|
end
|
||||||
|
@ -70,8 +70,8 @@ class TestRubyVMMJIT < Test::Unit::TestCase
|
||||||
eval("def mjit#{i}; end; mjit#{i}")
|
eval("def mjit#{i}; end; mjit#{i}")
|
||||||
i += 1
|
i += 1
|
||||||
end
|
end
|
||||||
print RubyVM::MJIT.pause(wait: false)
|
print RubyVM::JIT.pause(wait: false)
|
||||||
print RubyVM::MJIT.pause(wait: false)
|
print RubyVM::JIT.pause(wait: false)
|
||||||
EOS
|
EOS
|
||||||
assert_equal('truefalse', out)
|
assert_equal('truefalse', out)
|
||||||
assert_equal(true, err.scan(/#{JITSupport::JIT_SUCCESS_PREFIX}/).size < 10)
|
assert_equal(true, err.scan(/#{JITSupport::JIT_SUCCESS_PREFIX}/).size < 10)
|
||||||
|
@ -79,11 +79,11 @@ class TestRubyVMMJIT < Test::Unit::TestCase
|
||||||
|
|
||||||
def test_resume
|
def test_resume
|
||||||
out, err = eval_with_jit(<<~'EOS', verbose: 1, min_calls: 1, wait: false)
|
out, err = eval_with_jit(<<~'EOS', verbose: 1, min_calls: 1, wait: false)
|
||||||
print RubyVM::MJIT.resume
|
print RubyVM::JIT.resume
|
||||||
print RubyVM::MJIT.pause
|
print RubyVM::JIT.pause
|
||||||
print RubyVM::MJIT.resume
|
print RubyVM::JIT.resume
|
||||||
print RubyVM::MJIT.resume
|
print RubyVM::JIT.resume
|
||||||
print RubyVM::MJIT.pause
|
print RubyVM::JIT.pause
|
||||||
EOS
|
EOS
|
||||||
assert_equal('falsetruetruefalsetrue', out)
|
assert_equal('falsetruetruefalsetrue', out)
|
||||||
assert_equal(0, err.scan(/#{JITSupport::JIT_SUCCESS_PREFIX}/).size)
|
assert_equal(0, err.scan(/#{JITSupport::JIT_SUCCESS_PREFIX}/).size)
|
|
@ -1963,7 +1963,7 @@ class TestSetTraceFunc < Test::Unit::TestCase
|
||||||
Thread.pass until t.status == 'sleep'
|
Thread.pass until t.status == 'sleep'
|
||||||
# When MJIT thread exists, t.status becomes 'sleep' even if it does not reach m2t_q.pop.
|
# When MJIT thread exists, t.status becomes 'sleep' even if it does not reach m2t_q.pop.
|
||||||
# This sleep forces it to reach m2t_q.pop for --jit-wait.
|
# This sleep forces it to reach m2t_q.pop for --jit-wait.
|
||||||
sleep 1 if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
|
sleep 1 if defined?(RubyVM::JIT) && RubyVM::JIT.enabled?
|
||||||
|
|
||||||
t.add_trace_func proc{|ev, file, line, *args|
|
t.add_trace_func proc{|ev, file, line, *args|
|
||||||
if file == __FILE__
|
if file == __FILE__
|
||||||
|
|
|
@ -309,7 +309,7 @@ class TestThread < Test::Unit::TestCase
|
||||||
s += 1
|
s += 1
|
||||||
end
|
end
|
||||||
Thread.pass until t.stop?
|
Thread.pass until t.stop?
|
||||||
sleep 1 if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # t.stop? behaves unexpectedly with --jit-wait
|
sleep 1 if defined?(RubyVM::JIT) && RubyVM::JIT.enabled? # t.stop? behaves unexpectedly with --jit-wait
|
||||||
assert_equal(1, s)
|
assert_equal(1, s)
|
||||||
t.wakeup
|
t.wakeup
|
||||||
Thread.pass while t.alive?
|
Thread.pass while t.alive?
|
||||||
|
@ -1338,7 +1338,7 @@ q.pop
|
||||||
opts = { timeout: 5, timeout_error: nil }
|
opts = { timeout: 5, timeout_error: nil }
|
||||||
|
|
||||||
# prevent SIGABRT from slow shutdown with MJIT
|
# prevent SIGABRT from slow shutdown with MJIT
|
||||||
opts[:reprieve] = 3 if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
|
opts[:reprieve] = 3 if defined?(RubyVM::JIT) && RubyVM::JIT.enabled?
|
||||||
|
|
||||||
assert_normal_exit(<<-_end, '[Bug #8996]', **opts)
|
assert_normal_exit(<<-_end, '[Bug #8996]', **opts)
|
||||||
Thread.report_on_exception = false
|
Thread.report_on_exception = false
|
||||||
|
|
|
@ -5,7 +5,7 @@ require 'timeout'
|
||||||
|
|
||||||
class TestGemStreamUI < Gem::TestCase
|
class TestGemStreamUI < Gem::TestCase
|
||||||
# increase timeout with MJIT for --jit-wait testing
|
# increase timeout with MJIT for --jit-wait testing
|
||||||
mjit_enabled = defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
|
mjit_enabled = defined?(RubyVM::JIT) && RubyVM::JIT.enabled?
|
||||||
SHORT_TIMEOUT = (RUBY_ENGINE == "ruby" && !mjit_enabled) ? 0.1 : 1.0
|
SHORT_TIMEOUT = (RUBY_ENGINE == "ruby" && !mjit_enabled) ? 0.1 : 1.0
|
||||||
|
|
||||||
module IsTty
|
module IsTty
|
||||||
|
|
|
@ -478,7 +478,7 @@ class TestSocket < Test::Unit::TestCase
|
||||||
end while IO.select([r], nil, nil, 0.1).nil?
|
end while IO.select([r], nil, nil, 0.1).nil?
|
||||||
n
|
n
|
||||||
end
|
end
|
||||||
timeout = (defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? ? 120 : 30) # for --jit-wait
|
timeout = (defined?(RubyVM::JIT) && RubyVM::JIT.enabled? ? 120 : 30) # for --jit-wait
|
||||||
assert_equal([[s1],[],[]], IO.select([s1], nil, nil, timeout))
|
assert_equal([[s1],[],[]], IO.select([s1], nil, nil, timeout))
|
||||||
msg, _, _, stamp = s1.recvmsg
|
msg, _, _, stamp = s1.recvmsg
|
||||||
assert_equal("a", msg)
|
assert_equal("a", msg)
|
||||||
|
|
|
@ -973,7 +973,7 @@ module MiniTest
|
||||||
puts if @verbose
|
puts if @verbose
|
||||||
$stdout.flush
|
$stdout.flush
|
||||||
|
|
||||||
unless defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # compiler process is wrongly considered as leak
|
unless defined?(RubyVM::JIT) && RubyVM::JIT.enabled? # compiler process is wrongly considered as leak
|
||||||
leakchecker.check("#{inst.class}\##{inst.__name__}")
|
leakchecker.check("#{inst.class}\##{inst.__name__}")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -115,7 +115,7 @@ module Test
|
||||||
|
|
||||||
def assert_no_memory_leak(args, prepare, code, message=nil, limit: 2.0, rss: false, **opt)
|
def assert_no_memory_leak(args, prepare, code, message=nil, limit: 2.0, rss: false, **opt)
|
||||||
# TODO: consider choosing some appropriate limit for MJIT and stop skipping this once it does not randomly fail
|
# TODO: consider choosing some appropriate limit for MJIT and stop skipping this once it does not randomly fail
|
||||||
pend 'assert_no_memory_leak may consider MJIT memory usage as leak' if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
|
pend 'assert_no_memory_leak may consider MJIT memory usage as leak' if defined?(RubyVM::JIT) && RubyVM::JIT.enabled?
|
||||||
|
|
||||||
require_relative '../../memory_status'
|
require_relative '../../memory_status'
|
||||||
raise MiniTest::Skip, "unsupported platform" unless defined?(Memory::Status)
|
raise MiniTest::Skip, "unsupported platform" unless defined?(Memory::Status)
|
||||||
|
|
|
@ -6,7 +6,7 @@ class TestHideSkip < Test::Unit::TestCase
|
||||||
assert_not_match(/^ *1\) Skipped/, hideskip)
|
assert_not_match(/^ *1\) Skipped/, hideskip)
|
||||||
assert_match(/^ *1\) Skipped/, hideskip("--show-skip"))
|
assert_match(/^ *1\) Skipped/, hideskip("--show-skip"))
|
||||||
output = hideskip("--hide-skip")
|
output = hideskip("--hide-skip")
|
||||||
output.gsub!(/Successful MJIT finish\n/, '') if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
|
output.gsub!(/Successful MJIT finish\n/, '') if defined?(RubyVM::JIT) && RubyVM::JIT.enabled?
|
||||||
assert_match(/assertions\/s.\n+1 tests, 0 assertions, 0 failures, 0 errors, 1 skips/, output)
|
assert_match(/assertions\/s.\n+1 tests, 0 assertions, 0 failures, 0 errors, 1 skips/, output)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ module TestParallel
|
||||||
PARALLEL_RB = "#{File.dirname(__FILE__)}/../../lib/test/unit/parallel.rb"
|
PARALLEL_RB = "#{File.dirname(__FILE__)}/../../lib/test/unit/parallel.rb"
|
||||||
TESTS = "#{File.dirname(__FILE__)}/tests_for_parallel"
|
TESTS = "#{File.dirname(__FILE__)}/tests_for_parallel"
|
||||||
# use large timeout for --jit-wait
|
# use large timeout for --jit-wait
|
||||||
TIMEOUT = EnvUtil.apply_timeout_scale(defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? ? 100 : 30)
|
TIMEOUT = EnvUtil.apply_timeout_scale(defined?(RubyVM::JIT) && RubyVM::JIT.enabled? ? 100 : 30)
|
||||||
|
|
||||||
class TestParallelWorker < Test::Unit::TestCase
|
class TestParallelWorker < Test::Unit::TestCase
|
||||||
def setup
|
def setup
|
||||||
|
|
|
@ -253,7 +253,7 @@ class TestWEBrickHTTPServer < Test::Unit::TestCase
|
||||||
server.virtual_host(WEBrick::HTTPServer.new(vhost_config))
|
server.virtual_host(WEBrick::HTTPServer.new(vhost_config))
|
||||||
|
|
||||||
Thread.pass while server.status != :Running
|
Thread.pass while server.status != :Running
|
||||||
sleep 1 if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # server.status behaves unexpectedly with --jit-wait
|
sleep 1 if defined?(RubyVM::JIT) && RubyVM::JIT.enabled? # server.status behaves unexpectedly with --jit-wait
|
||||||
assert_equal(1, started, log.call)
|
assert_equal(1, started, log.call)
|
||||||
assert_equal(0, stopped, log.call)
|
assert_equal(0, stopped, log.call)
|
||||||
assert_equal(0, accepted, log.call)
|
assert_equal(0, accepted, log.call)
|
||||||
|
|
|
@ -65,7 +65,7 @@ class TestWEBrickServer < Test::Unit::TestCase
|
||||||
}
|
}
|
||||||
TestWEBrick.start_server(Echo, config){|server, addr, port, log|
|
TestWEBrick.start_server(Echo, config){|server, addr, port, log|
|
||||||
true while server.status != :Running
|
true while server.status != :Running
|
||||||
sleep 1 if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # server.status behaves unexpectedly with --jit-wait
|
sleep 1 if defined?(RubyVM::JIT) && RubyVM::JIT.enabled? # server.status behaves unexpectedly with --jit-wait
|
||||||
assert_equal(1, started, log.call)
|
assert_equal(1, started, log.call)
|
||||||
assert_equal(0, stopped, log.call)
|
assert_equal(0, stopped, log.call)
|
||||||
assert_equal(0, accepted, log.call)
|
assert_equal(0, accepted, log.call)
|
||||||
|
|
21
vm.c
21
vm.c
|
@ -3198,13 +3198,13 @@ core_hash_merge_kwd(VALUE hash, VALUE kw)
|
||||||
|
|
||||||
/* Returns true if JIT is enabled */
|
/* Returns true if JIT is enabled */
|
||||||
static VALUE
|
static VALUE
|
||||||
mjit_enabled_p(VALUE _)
|
jit_enabled_p(VALUE _)
|
||||||
{
|
{
|
||||||
return mjit_enabled ? Qtrue : Qfalse;
|
return mjit_enabled ? Qtrue : Qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
mjit_pause_m(int argc, VALUE *argv, RB_UNUSED_VAR(VALUE self))
|
jit_pause_m(int argc, VALUE *argv, RB_UNUSED_VAR(VALUE self))
|
||||||
{
|
{
|
||||||
VALUE options = Qnil;
|
VALUE options = Qnil;
|
||||||
VALUE wait = Qtrue;
|
VALUE wait = Qtrue;
|
||||||
|
@ -3221,7 +3221,7 @@ mjit_pause_m(int argc, VALUE *argv, RB_UNUSED_VAR(VALUE self))
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
mjit_resume_m(VALUE _)
|
jit_resume_m(VALUE _)
|
||||||
{
|
{
|
||||||
return mjit_resume();
|
return mjit_resume();
|
||||||
}
|
}
|
||||||
|
@ -3317,7 +3317,7 @@ Init_VM(void)
|
||||||
VALUE opts;
|
VALUE opts;
|
||||||
VALUE klass;
|
VALUE klass;
|
||||||
VALUE fcore;
|
VALUE fcore;
|
||||||
VALUE mjit;
|
VALUE jit;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Document-class: RubyVM
|
* Document-class: RubyVM
|
||||||
|
@ -3362,14 +3362,17 @@ Init_VM(void)
|
||||||
rb_gc_register_mark_object(fcore);
|
rb_gc_register_mark_object(fcore);
|
||||||
rb_mRubyVMFrozenCore = fcore;
|
rb_mRubyVMFrozenCore = fcore;
|
||||||
|
|
||||||
/* ::RubyVM::MJIT
|
/* ::RubyVM::JIT
|
||||||
* Provides access to the Method JIT compiler of MRI.
|
* Provides access to the Method JIT compiler of MRI.
|
||||||
* Of course, this module is MRI specific.
|
* Of course, this module is MRI specific.
|
||||||
*/
|
*/
|
||||||
mjit = rb_define_module_under(rb_cRubyVM, "MJIT");
|
jit = rb_define_module_under(rb_cRubyVM, "JIT");
|
||||||
rb_define_singleton_method(mjit, "enabled?", mjit_enabled_p, 0);
|
rb_define_singleton_method(jit, "enabled?", jit_enabled_p, 0);
|
||||||
rb_define_singleton_method(mjit, "pause", mjit_pause_m, -1);
|
rb_define_singleton_method(jit, "pause", jit_pause_m, -1);
|
||||||
rb_define_singleton_method(mjit, "resume", mjit_resume_m, 0);
|
rb_define_singleton_method(jit, "resume", jit_resume_m, 0);
|
||||||
|
/* RubyVM::MJIT for short-term backward compatibility */
|
||||||
|
rb_const_set(rb_cRubyVM, rb_intern("MJIT"), jit);
|
||||||
|
rb_deprecate_constant(rb_cRubyVM, "MJIT");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Document-class: Thread
|
* Document-class: Thread
|
||||||
|
|
Loading…
Add table
Reference in a new issue