ruby-changes:51274
From: k0kubun <ko1@a...>
Date: Mon, 21 May 2018 23:33:01 +0900 (JST)
Subject: [ruby-changes:51274] k0kubun:r63480 (trunk): mjit.h: skip accessing mjit_opts if JIT-ed
k0kubun 2018-05-21 23:32:55 +0900 (Mon, 21 May 2018) New Revision: 63480 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63480 Log: mjit.h: skip accessing mjit_opts if JIT-ed We want to skip checking `mjit_opts.wait` for already JIT-ed case. Optcarrot is slightly improved like 65.20 fps -> 66.60 fps. Modified files: trunk/mjit.h Index: mjit.h =================================================================== --- mjit.h (revision 63479) +++ mjit.h (revision 63480) @@ -102,17 +102,14 @@ mjit_exec(rb_execution_context_t *ec) https://github.com/ruby/ruby/blob/trunk/mjit.h#L102 total_calls = ++body->total_calls; func = body->jit_func; - if (UNLIKELY(mjit_opts.wait && mjit_opts.min_calls == total_calls && mjit_target_iseq_p(body) - && func == (mjit_func_t)NOT_ADDED_JIT_ISEQ_FUNC)) { - mjit_add_iseq_to_process(iseq); - func = mjit_get_iseq_func(body); - } - if (UNLIKELY((ptrdiff_t)func <= (ptrdiff_t)LAST_JIT_ISEQ_FUNC)) { switch ((enum rb_mjit_iseq_func)func) { case NOT_ADDED_JIT_ISEQ_FUNC: if (total_calls == mjit_opts.min_calls && mjit_target_iseq_p(body)) { mjit_add_iseq_to_process(iseq); + if (UNLIKELY(mjit_opts.wait)) { + func = mjit_get_iseq_func(body); + } } return Qundef; case NOT_READY_JIT_ISEQ_FUNC: -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/