ruby-changes:68763
From: Maxime <ko1@a...>
Date: Thu, 21 Oct 2021 08:13:28 +0900 (JST)
Subject: [ruby-changes:68763] e7d20e6616 (master): Free block->incoming in invalidate_block_version()
https://git.ruby-lang.org/ruby.git/commit/?id=e7d20e6616 From e7d20e6616546c9b26ce3c8eb9663e6805d0d0bf Mon Sep 17 00:00:00 2001 From: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@s...> Date: Thu, 11 Feb 2021 15:27:33 -0500 Subject: Free block->incoming in invalidate_block_version() --- misc/gen_call_test.rb | 47 ----------------------------------------------- ujit_core.c | 10 +++++----- 2 files changed, 5 insertions(+), 52 deletions(-) delete mode 100644 misc/gen_call_test.rb diff --git a/misc/gen_call_test.rb b/misc/gen_call_test.rb deleted file mode 100644 index 206beda22e..0000000000 --- a/misc/gen_call_test.rb +++ /dev/null @@ -1,47 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/#L0 -NUM_LEVELS = 30 -FNS_PER_LEVEL = 1000 - -$out = "" - -def addln(str = "") - $out << str << "\n" -end - -NUM_LEVELS.times do |l_no| - FNS_PER_LEVEL.times do |f_no| - f_name = "fun_l#{l_no}_n#{f_no}" - - if l_no < NUM_LEVELS - 1 - callee_no = rand(0...FNS_PER_LEVEL) - callee_name = "fun_l#{l_no+1}_n#{callee_no}" - else - callee_name = "inc" - end - - addln("def #{f_name}()") - addln(" #{callee_name}") - addln("end") - addln() - end -end - -addln("@a = 0") -addln("@b = 0") -addln("@c = 0") -addln("@d = 0") -addln("@count = 0") -addln("def inc()") -addln(" @count += 1") -addln("end") - -# 100K times -addln("100000.times do") - FNS_PER_LEVEL.times do |f_no| - f_name = "fun_l0_n#{f_no}" - addln(" #{f_name}") - end -addln("end") - -addln("puts @count") - -puts($out) \ No newline at end of file diff --git a/ujit_core.c b/ujit_core.c index 63a482aefe..1ed8c47a99 100644 --- a/ujit_core.c +++ b/ujit_core.c @@ -647,15 +647,15 @@ invalidate_block_version(block_t* block) https://github.com/ruby/ruby/blob/trunk/ujit_core.c#L647 void* handler_addr = (void*)handler_table[entry_opcode]; iseq->body->iseq_encoded[idx] = (VALUE)handler_addr; - // - // Optional: may want to recompile a new deoptimized entry point - // - // TODO: + // May want to recompile a new entry point (for interpreter entry blocks) + // This isn't necessary for correctness + + // FIXME: // Call continuation addresses on the stack can also be atomically replaced by jumps going to the stub. - // For now this isn't an issue // Free the old block version object + free(block->incoming); free(block); fprintf(stderr, "invalidation done\n"); -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/