ruby-changes:68653
From: Alan <ko1@a...>
Date: Thu, 21 Oct 2021 08:11:43 +0900 (JST)
Subject: [ruby-changes:68653] 50d8c3d443 (master): MicroJIT: Count number of compiled instructions better
https://git.ruby-lang.org/ruby.git/commit/?id=50d8c3d443 From 50d8c3d4430cc8726b0d2745440e9de01eb4dfb9 Mon Sep 17 00:00:00 2001 From: Alan Wu <XrXr@u...> Date: Wed, 4 Nov 2020 12:03:39 -0500 Subject: MicroJIT: Count number of compiled instructions better --- ujit_compile.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ujit_compile.c b/ujit_compile.c index 6a2863c1c8..e6b3864cd9 100644 --- a/ujit_compile.c +++ b/ujit_compile.c @@ -402,8 +402,8 @@ ujit_compile_insn(const rb_iseq_t *iseq, unsigned int insn_idx, unsigned int *ne https://github.com/ruby/ruby/blob/trunk/ujit_compile.c#L402 ctx.replacement_idx = insn_idx; // For each instruction to compile - unsigned num_instrs; - for (num_instrs = 0;; ++num_instrs) { + unsigned num_instrs = 0; + for (;;) { // Set the current PC ctx.pc = &encoded[insn_idx]; @@ -434,6 +434,7 @@ ujit_compile_insn(const rb_iseq_t *iseq, unsigned int insn_idx, unsigned int *ne https://github.com/ruby/ruby/blob/trunk/ujit_compile.c#L434 // Move to the next instruction insn_idx += insn_len(opcode); + num_instrs++; // Ensure we only have one send per region. Our code invalidation mechanism can't // invalidate running code and one send could invalidate the other if we had -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/