diff options
author | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-07-29 02:05:08 +0000 |
---|---|---|
committer | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-07-29 02:05:08 +0000 |
commit | 82bd2a9cc017e3d9ff140b866a6bffaeb4488104 (patch) | |
tree | 059b7029bf1fcf03acc93c16773fa3c98df96683 /test/ruby/test_jit.rb | |
parent | c5a5563dbe48497fd00a14de82ec359204b06365 (diff) | |
download | ruby-82bd2a9cc017e3d9ff140b866a6bffaeb4488104.tar.gz |
mjit.c: disable compaction on empty queue w/ --jit-wait
When --jit-wait is specified, `unit_queue.length` is always 0 and it's
not a good metric.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_jit.rb')
-rw-r--r-- | test/ruby/test_jit.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb index 04b0a0b74a..5457bd3f45 100644 --- a/test/ruby/test_jit.rb +++ b/test/ruby/test_jit.rb @@ -9,7 +9,6 @@ class TestJIT < Test::Unit::TestCase IGNORABLE_PATTERNS = [ /\ASuccessful MJIT finish\n\z/, - /\AJIT compaction \(\d+\.\dms\): Compacted \d+ methods ->/, ] # trace_* insns are not compiled for now... @@ -549,8 +548,8 @@ class TestJIT < Test::Unit::TestCase end end; assert_equal('0123456789', out) - errs = err.lines.reject do |l| - IGNORABLE_PATTERNS.any? { |pat| pat.match?(l) } + compactions, errs = err.lines.partition do |l| + l.match?(/\AJIT compaction \(\d+\.\dms\): Compacted \d+ methods ->/) end assert_match(/\A#{JIT_SUCCESS_PREFIX}: block in <main>@-e:/, errs[0]) 9.times do |i| @@ -559,6 +558,10 @@ class TestJIT < Test::Unit::TestCase assert_equal("Too many JIT code -- 1 units unloaded\n", errs[10]) assert_match(/\A#{JIT_SUCCESS_PREFIX}: mjit9@\(eval\):/, errs[11]) + # On --jit-wait, when the number of JIT-ed code reaches --jit-max-cache, + # it should trigger compaction. + assert_equal(2, compactions.size) + # verify .o files are deleted on unload_units assert_send([Dir, :empty?, dir]) end |