From e8a78d7df899291aa025e41207436a450235a4d7 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Thu, 30 Apr 2020 21:37:55 -0700 Subject: Do not stop the world during JIT compaction Running C compiler for JIT compaction inside a critical section may lock main thread for a long time when it triggers GC. As I'm planning to increase this duration a bit, I'd like to make sure this doesn't stop the world. For now, I chose to give up unloading units when it's during JIT compaction, assuming other calls may unload them later. --- test/ruby/test_jit.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test/ruby/test_jit.rb') diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb index 9e4367b6d1..1d0c86d7d7 100644 --- a/test/ruby/test_jit.rb +++ b/test/ruby/test_jit.rb @@ -14,6 +14,7 @@ class TestJIT < Test::Unit::TestCase ] MAX_CACHE_PATTERNS = [ /\AJIT compaction \([^)]+\): .+\n\z/, + /\AToo many JIT code, but skipped unloading units for JIT compaction\n\z/, /\ANo units can be unloaded -- .+\n\z/, ] @@ -700,8 +701,9 @@ class TestJIT < Test::Unit::TestCase 10.times do |i| assert_match(/\A#{JIT_SUCCESS_PREFIX}: mjit#{i}@\(eval\):/, errs[i], debug_info) end - assert_equal("Too many JIT code -- 1 units unloaded\n", errs[10], debug_info) - assert_match(/\A#{JIT_SUCCESS_PREFIX}: mjit10@\(eval\):/, errs[11], debug_info) + assert_equal("Too many JIT code, but skipped unloading units for JIT compaction\n", errs[10], debug_info) + assert_equal("No units can be unloaded -- incremented max-cache-size to 11 for --jit-wait\n", errs[11], debug_info) + assert_match(/\A#{JIT_SUCCESS_PREFIX}: mjit10@\(eval\):/, errs[12], debug_info) # On --jit-wait, when the number of JIT-ed code reaches --jit-max-cache, # it should trigger compaction. -- cgit v1.2.3